Skip to content

Instantly share code, notes, and snippets.

@jeffcogswell
Last active March 19, 2024 20:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeffcogswell/d8542156a5ede2cd0ce8fc24a04f8515 to your computer and use it in GitHub Desktop.
Save jeffcogswell/d8542156a5ede2cd0ce8fc24a04f8515 to your computer and use it in GitHub Desktop.
Git Credential Manager Core in WSL2

I'll add more to this later but for now:

Find out how I have it set in regular Windows from the command prompt:

git config --list

Output:

... etc

credential.helper=C:/Program\ Files\ \(x86\)/Git\ Credential\ Manager\ Core/git-credential-manager-core.exe

... etc

That's the command above with escapes.

Here then is what I run in WSL2 Ubuntu shell; notice I'm adding /mnt/c/ and removing the colon.

git config --global credential.helper "/mnt/c/Program\ Files\ \(x86\)/Git\ Credential\ Manager\ Core/git-credential-manager-core.exe"

References: With some help from https://stackoverflow.com/questions/45925964/how-to-use-git-credential-store-on-wsl-ubuntu-on-windows

(Still testing, not sure it's working yet...)

@FeignMan
Copy link

Hey man, here's a tip - try using the wslpath utility to convert a wsl path to a windows path and vice-versa.
https://github.com/MiffOttah/wslpath

It's not made by Microsoft, but I find that at least on the Ubuntu distros (for wsl2) it comes preinstalled. Life's better since I found this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment