Writes creds in cleartext. Convenient. Insecure. Know the trade.
git credential-store saves credentials in plaintext on disk. It just works, everywhere, and exposes your tokens to anyone who reads the file.
A flat file of https://user:token@host URLs. No encryption. No expiry. If the threat model includes 'someone reads my home directory', this helper is wrong.
git config --global credential.helper store
git config --global credential.helper 'store --file=~/.git-creds-work'
# File format (one line each):
# https://alice:ghp_xxx@github.com
# https://bob:token@gitlab.example.com| Flag | What it does |
|---|---|
--file=<path> | Override the storage file; default ~/.git-credentials then $XDG_CONFIG_HOME/git/credentials |
store | Plumbing: append a cred to the file |
get | Plumbing: look up a cred |
erase | Plumbing: remove matching lines |
default permissions | ⚠️ File is created mode 600 — but plaintext is still plaintext |
git credential-store store < cred.txtgit credential-store get < desc.txtgit credential-store erase < desc.txtcache won't survive long-running jobs.--file paths and per-host helpers.git config --global credential.helper storegit -C ~/work config credential.helper 'store --file=~/.git-creds-work'cat ~/.git-credentialsrm ~/.git-credentialsosxkeychain, wincred, manager, or libsecret.credential.<url>.helper and a dedicated file.find will happily slurp ~/.git-credentials — the secret leaks with your home dir.Hit each option, then Check answers. Score is recorded; Next is always open.