Created
January 20, 2021 05:19
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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