gitgithubwindows-subsystem-for-linuxgit-credential-manager

Git Credential Manager Not Found on WSL2


Error Message

/mnt/c/Program\ Files/Git/mingw64/libexec/git-core/git-credential-manager-core.exe get: 1: /mnt/c/Program Files/Git/mingw64/libexec/git-core/git-credential-manager-core.exe: not found

Problem Story

I found this problem then git ask me for a username and password to authenticate to GitHub whenever I'm doing git activity with GitHub remote repository from my local WSL2 environment.

It is very annoying to do this every time, then I search and follow several tutorials I can find on the internet, but everything just led me to the same problem again, these tutorial is not solving my problem at all.

Every tutorial tells me that I should add the GCM directory in the Windows environment for the git in the WSL2 environment. Theoretically, it should solve my problem, but it is not.


Solution

  • Solution

    If there is no git-credential-core.exe in your git folder, then use it instead of the git-credential-wincred.exe. No -core executable file exists, so I use the -wincred file.

    Execute this command on WSL2 (use the -core rather than -wincred if it exists):

    git config --global credential.helper "/mnt/c/Program\ Files/Git/mingw64/libexec/git-core/git-credential-core.exe"
    

    only if the above command ❌ fails or does not solve the problem, change to -wincred

    git config --global credential.helper "/mnt/c/Program\ Files/Git/mingw64/libexec/git-core/git-credential-wincred.exe"
    

    Explanation

    I think git-credential-manager-core.exe has already been renamed git-credential-wincred.exe, but many tutorials on the internet are already deprecated because they gave us the old name of this executable file. This is my biggest problem because following any tutorial makes me find the same error over time.