Git Credential
Cache in memory (temporarily)
git config credential.helper cache
default: 900
seconds.
Set number of seconds to cache credentials:
git config credential.helper 'cache --timeout=<seconds>'
Store on disk (unencrypted)
Warning: Store your password in local host, ensure you are working in a secure environment.
git config --global credential.helper store
Default: ~/.git-credentials
and $XDG_CONFIG_HOME/git/credentials
.
Use <path>
to lookup and store credentials:
git config --global credential.helper 'store --file=<path>'
macOS (KeyChain)
git config --global credential.helper osxkeychain
Linux (Libsecret)
sudo apt install libsecret-1-dev
cd /usr/share/doc/git/contrib/credential/libsecret
sudo make
git config --global credential.helper /usr/share/doc/git/contrib/credential/libsecret/git-credential-libsecret