Git Credential Manager Setup

by | Dec 23, 2024 | IT Tips | 0 comments

Goto https://github.com/git-ecosystem/git-credential-manager/releases/tag/v2.6.0 and download latest release

I did this on linux or WSL to allow doing a git clone of a private repo using the https:// URL

# get the latest gcm
wget https://github.com/git-ecosystem/git-credential-manager/releases/download/v2.6.0/gcm-linux_amd64.2.6.0.deb
sudo apt-get install ./gcm-linux_amd64.2.6.0.deb
sudo apt-get install pass

# generate a gpg key
gpg --gen-key

pass init 53DE2658ABE808AF2CC3CAA8E40D959BC610792B

git config --global credential.credentialStore gpg

git credential-manager configure

git credential-manager github login

# choose login with code and goto https://github.com/login/device...

Once you have installed & configured gcm you can then do a git clone of a private repo and it will authenticate automatically after asking for the gpg key passphrase

Troubleshooting

On WSL Ubuntu 24.04.1 LTS. After it works once after setting it up as above you try to use it at another time and you get a failure to decrypt

fatal: Failed to decrypt file '/home/user/.password-store/git/https/github.com/keyname.gpg' with gpg. exit=2, out=, err=gpg: encrypted with cv25519 key, ID D1G64BA315F0A254, created 2024-12-23
      "Rupert McBlogger <[email protected]>"
gpg: public key decryption failed: Inappropriate ioctl for device
gpg: decryption failed: Inappropriate ioctl for device

Add to ~/.bashrc and restart wsl or reboot

# ~/.bashrc

export GPG_TTY=$(tty)

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

The reCAPTCHA verification period has expired. Please reload the page.