One password is no problem
I wanted to store my credentials "safely" for use by git so I did as instructed
here. This way I don't have to input password/PAT every single time, I perform any git operation.
Install
libsecretusingsudo apt-get install libsecret-1-0 libsecret-1-devBuild the "credential manager" using
sudo make --directory=/usr/share/doc/git/contrib/credential/libsecretand then configure my local git folder using
git config --global credential.helper \ /usr/share/doc/git/contrib/credential/libsecret/git-credential-libsecret
Works superb.
How to do the above with many passwords?
What I don't get is how to do the same for many passwords associated with different accounts/repositories. I was suggested to use gcm core.
I tried installing gcm core as instructed here.
Download .deb package
sudo dpkg -i <path-to-package> git-credential-manager-core configureconfigure the "credential store"
git config credential.credentialStore secretservice(as I use libsecret).I removed the
Credential helperpointing to/usr/share/doc/git/contrib/credential/libsecret/git-credential-libsecretfrom the local git config file.
It still doesn't work. When I try to push a repo, I get a garbled
message with how to use git config followed by request to fill in
credentials (shown here).  I don't understand what I am doing! namely credential store, credential manager, secret-service and gcm core.
                        
Any credential helper should follow the same process.
But if you have multiple account/password for the same domain (say github.com for instance), then you need to change your remote URL
That way, the credential helper will differentiate your different account.
Since gcm core is a bit fineky to install, test it first with the classic libsecret-based helper.