Piyush Behre's Blog

Sharing learnings from technology and business

Git Credentials Manager on WSL

Published on: Wed Jan 01 2025


Enterprises might choose to disable PAT and SSH. git-credentials-manager is the primary way to authenticate in this case.

But for WSL, it doesn’t quite work correctly out of the box. Here are the commands to get it working on WSL:

sudo apt update
sudo apt install git

# Get the latest url from https://github.com/git-ecosystem/git-credential-manager/releases
# You'd also need to install git-credentials-manager on windows. The same url has the package to install on Windows.
wget https://github.com/git-ecosystem/git-credential-manager/releases/latest/download/gcm-linux_amd64.2.6.1.deb
sudo dpkg -i gcm-linux_amd64.2.6.1.deb

# this sets it to point to the Windows version
git config --global credential.helper "/mnt/c/Program\\ Files/Git/mingw64/bin/git-credential-manager.exe"

git clone ...