GitHub CLI: command not found

Viewed 451

I have git and gh, both installed through scoop. I set up the git authentication using

gh auth login
gh auth setup-git

However, when trying to git fetch, I get the following error:

C:\Users\[user]\scoop\apps\gh\current\bin\gh.exe auth git-credential get: C:Users[user]scoopappsghcurrentbingh.exe: command not found
C:\Users\[user]\scoop\apps\gh\current\bin\gh.exe auth git-credential store: C:Users[user]scoopappsghcurrentbingh.exe: command not found

This is my .gitconfig:

[core]
    editor = \"C:\\Users\\[user]\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe\" --wait
[gui]
    recentrepo = C:/Users/[user]/Python/Coney_Colabs
    recentrepo = "C:/Users/[user]/C#/azrielCode"
[user]
    email = [user]@gmail.com
    name = [user]
[credential "https://github.com"]
    helper = 
    helper = !C:\\Users\\[user]\\scoop\\apps\\gh\\current\\bin\\gh.exe auth git-credential
[credential "https://gist.github.com"]
    helper = 
    helper = !C:\\Users\\[user]\\scoop\\apps\\gh\\current\\bin\\gh.exe auth git-credential
[credential]
    helper = manager-core
1 Answers

You should see:

helper = !\"C:\\Users\\[user]\\scoop\\apps\\gh\\current\\bin\\gh.exe\" auth git-credential

But an alternative approach if to make sure your %PATH% includes C:\Users\[user]\scoop\apps\gh\current\bin, and simply use gh.exe auth git-credential in your config. No more escaped backslash.

Related