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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# get the latest gcm
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

1
2
3
4
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 <rupert@example.com.au>"
gpg: public key decryption failed: Inappropriate ioctl for device
gpg: decryption failed: Inappropriate ioctl for device

Add to ~/.bashrc and restart wsl or reboot

1
2
3
# ~/.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.