Caches creds for a few minutes.
git credential-cache keeps credentials in RAM via a small daemon, expiring them after a timeout. Convenient for short sessions; gone after logout.
A unix-socket daemon holds the secrets. Git asks it via the credential protocol. No disk. No keychain. Pure volatility — that's the whole point.
git config --global credential.helper 'cache'
git config --global credential.helper 'cache --timeout=3600'
git config --global credential.helper 'cache --socket=/tmp/git-cred-sock'
git credential-cache exit # kill the daemon now
git credential-cache <get|store|erase> # plumbing| Flag | What it does |
|---|---|
--timeout=<secs> | How long to keep creds; default 900 (15 min) |
--socket=<path> | Custom socket location; default ~/.cache/git/credential/socket |
get | Plumbing: return cached cred for a description |
store | Plumbing: cache a cred |
erase | Plumbing: drop a cached cred |
exit | ⚠️ Kill the cache daemon immediately, dropping all cached creds |
git credential-cache exitgit credential-cache get < desc.txtgit credential-cache store < cred.txtgit credential-cache erase < desc.txtgit config --global credential.helper 'cache --timeout=3600'git config --global credential.helper 'cache --socket=$XDG_RUNTIME_DIR/git-cred'git credential-cache exitprintf 'protocol=https\nhost=github.com\n\n' | git credential fillcache for ephemeral or shared environments.git credential-cache exit in logout scripts on shared boxes.manager or wincred instead.Hit each option, then Check answers. Score is recorded; Next is always open.