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/socket unless ~/.git-credential-cache/ exists, in which case ~/.git-credential-cache/socket is 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