Skip to content

Instantly share code, notes, and snippets.

@dantman
Created January 20, 2021 05:19
Show Gist options
  • Save dantman/e8cf0cfd8475d5d3334f70e0cc5a225d to your computer and use it in GitHub Desktop.
Save dantman/e8cf0cfd8475d5d3334f70e0cc5a225d to your computer and use it in GitHub Desktop.
WSL Bash script that makes the Linux `git` use the same Windows based credential manager as the host system's git.exe
echo "Setup WSL's Git to use the same credential manager that the Windows git.exe is using"
GIT_CREDENTIAL_MANAGER_CORE_EXE=$(wslpath "$(git.exe config --global --get credential.helper | sed 's/\\\(\s\)/\1/g')" | sed 's/\(\s\)/\\\1/g')
git config --global credential.helper "$GIT_CREDENTIAL_MANAGER_CORE_EXE"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment