look@me

Bit #6: Securely storing Git passwords in WSL2

Storing Git passwords securely in WSL2 can be quite challenging, as there is no default credential store like those available on macOS and Windows.1 However, if we have a working Git installation on Windows, we can simply use its Git Credential Manager, which by default utilizes the Windows Credential Manager as the credential store.

git config --replace-all --global credential.helper  "/mnt/c/Program\ Files/Git/mingw64/bin/git-credential-manager.exe"

References and notes

  1. See the Git Credential Manager (GCM) documentation about credential stores.

#bit #git #windows #wsl