Skip to content

git credential helper doesn't work after brew upgrade gh (linuxbrew) #3704

@sadikkuzu

Description

@sadikkuzu

Describe the bug

git credential helper doesn't work after brew upgrade gh (linuxbrew)

Environment

Ubuntu 20.04
git version 2.25.1
gh version 1.9.2 (installed via linuxbrew)

Steps to reproduce the behavior

When I wrote gh --version, I saw "A new release of gh is available: 1.9.2 -> v1.10.3" message.
image

First, I want to show ~/.gitconfig:
helper = !/home/linuxbrew/.linuxbrew/Cellar/gh/1.9.2/bin/gh auth git-credential
(This is the result of gh auth login command.)
image

At that time, I could run "gh repo clone user/repo" (private repo), and "git pull".
image
image

But, when I upgraded gh via linuxbrew, I couldn't run "git pull" command for private repo.
gh version 1.10.3 (upgraded via linuxbrew)
image
image

To handle this situation, I changed the ~/.gitconfig
helper = !/home/linuxbrew/.linuxbrew/bin/gh auth git-credential
So I could pull a private repo
image
image

Expected vs actual behavior

Is it possible to get gitExe = !/home/linuxbrew/.linuxbrew/bin/gh
while using gh auth login

cli/git/git.go

Line 111 in 09b0981

gitExe, err := safeexec.LookPath("git")

Logs

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedContributions welcomepriority-2Affects more than a few users but doesn't prevent core functions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions