1

I am running WSL2 and trying to get Git Credential Manager (GCM) set up so that I don't have to always copy-paste my Github Personal Access Token into my terminal. Once I added the credential manager I was unable to access my remote repositories, this is what my .gitconfig looks like:

  1 [user]
  1     email = myemail@gmail.com
  2     name = Name
  3 [credential]
  4     helper = /mnt/c/Program\\ Files/Git/mingw64/libexec/git-core/git-credential-wincred.exe

Now when I do a git pull on the remote repository Git is telling me that it cannot be found. It's not clear to me why GCM is blocking me now, but would you have any recommendations for next steps?

GrayLiterature
  • 381
  • 2
  • 13

1 Answers1

0

git-credential-wincred.exe is the old legacy credential helper.

GCM is git-credential-manager-core.exe

helper = manager-core.exe

(it will be manager.exe with Git 2.39+)

Make sure your $PATH includes /mnt/c/Program Files/Git/mingw64/bin/

Then this would work (under a WSL2 bash session):

printf "host=github.com\nprotocol=https" | git-credential-manager-core.exe get
# or
printf "host=github.com\nprotocol=https" | git credential-manager-core.exe get
                                             ^^^

However, this would not:

printf "host=github.com\nprotocol=https" | git credential-manager-core get
                                                                     ^^^
fatal: 'credential-manager-core' appears to be a git command, 
       but we were not able to execute it. 
       Maybe git-credential-manager-core is broken?
sb813322
  • 129
  • 9
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250