GIT-CREDENTIAL-CACHE(1)
πΈ GIT-CREDENTIAL-CACHE(1) β the git manual, but make it cute πΈ
okay bestie, so this is a page from the Git Manual (yes, that git) and it's all about git-credential-cache, kthx. buckle up π
β¨ NAME β¨
git-credential-cache β a helper that temporarily stores your passwords in memory π
π¦ SYNOPSIS π¦
git config credential.helper 'cache [<options>]'
that's it. that's the whole vibe check. π«Ά
π DESCRIPTION π
okay so picture this: this command caches credentials for future Git programs to use. iconic behaviour, honestly. β¨
the stored credentials are kept in memory of the cache-daemon process (instead of being written to a file β yes bestie, no file, we love to see it) and they're forgotten after a configurable timeout. π
and they get forgotten sooner if the cache-daemon dies β like, for example, if the system restarts. π rip your credentials, gone too soon.
the cache is accessible over a Unix domain socket, and it's restricted to the current user by filesystem permissions. gatekeeping, but make it security. π₯
ngl you probably don't want to invoke this command directly, bestie β it's meant to be used as a credential helper by other parts of Git. check gitcredentials(7) or the EXAMPLES below if you're curious π
π OPTIONS π
--timeout <seconds>β how many seconds to cache your credentials for (default:900). yes, a number. yes, in seconds. slay. β³--socket <path>β use<path>to contact a running cache daemon (or start a new cache daemon if one is not started). defaults to$XDG_CACHE_HOME/git/credential/socketunless~/.git-credential-cache/exists, in which case~/.git-credential-cache/socketis used instead. and listen β if your home directory is on a network-mounted filesystem, you may need to change this to a local filesystem. also you must specify an absolute path, no cap. π
π CONTROLLING THE DAEMON π
so if you want the daemon to exit early β like, forgetting all cached credentials before their timeout even hits β you can issue an exit action:
git credential-cache exit
boom. daemon's gone. main character exit. π
β EXAMPLES β
the whole point of this helper is to reduce the number of times you must type your username or password. literally the dream. π
for example:
$ git config credential.helper cache
$ git push http://example.com/repo.git
Username: <type your username>
Password: <type your password>
[work for 5 more minutes]
$ git push http://example.com/repo.git
[your credentials are used automatically]
see? five minutes later and you didn't have to type a single thing. we ate. π
you can also provide options via the credential.helper configuration variable β this example increases the cache time to 1 hour:
$ git config credential.helper 'cache --timeout=3600'
3600 seconds of pure convenience. obsessed. π
π PERSONAL ACCESS TOKENS π
some remotes accept personal access tokens, which are randomly generated and hard to memorise. they typically have a lifetime of weeks or months. π
β οΈ real talk: git-credential-cache is inherently unsuitable for persistent storage of personal access tokens. the credential will be forgotten after the cache timeout. and even if you configure a long timeout, credentials will still be forgotten if the daemon dies. π
to avoid frequently regenerating personal access tokens, configure a credential helper with persistent storage. alternatively, configure an OAuth credential helper to generate credentials automatically. see gitcredentials(7), sections "Available helpers" and "OAuth". π
π GIT π
part of the git(1) suite. obviously. π
and that's the whole page bestie β brought to you by Git 2.56.0, dated 2026-09-27. mwah, go forth and cache responsibly π§ββοΈπ
π¦ where this page comes from
- arch rolling: git 2.56.0-1 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms