Used internally to fetch and store creds.
git credential is the plumbing Git uses to fetch, store, and reject credentials via helper programs. You almost never type it; you configure it.
Git speaks a tiny key=value protocol on stdin/stdout to a helper binary. The helper decides where the secret lives — RAM, disk, keychain, or a remote vault.
git credential <fill|approve|reject>
# Helper protocol (stdin):
# protocol=https
# host=github.com
# username=alice
# <blank line>
# Helper writes back username=... password=... on stdout.
git config --global credential.helper <helper>
git config --global credential.https://github.com.helper <helper>| Flag | What it does |
|---|---|
fill | Read a partial credential description, ask helpers to complete it |
approve | Tell helpers a credential worked — store it |
reject | Tell helpers a credential failed — erase it |
credential.helper=<bin> | Configure a helper; multiple allowed, queried in order |
credential.useHttpPath=true | Include URL path in the lookup key (per-repo creds) |
credential.helper= | ⚠️ Empty value RESETS the helper list — use to override system config |
echo -e 'protocol=https\nhost=github.com\n' | git credential fillgit credential approve < cred.txtgit credential reject < cred.txtprintf 'protocol=https\nhost=github.com\n\n' | git credential fillgit config --get-all credential.helpergit config --global credential.https://github.com.helper managergit config --global credential.helper '/usr/local/bin/my-helper'osxkeychain, wincred, manager, or libsecret.credential.helper per-host when you mix work and personal accounts.git credential fill before chasing phantom auth bugs.credential.helper entries stack — adding one doesn't replace the previous.credential.helper= line is required to clear inherited config; many forget it.Hit each option, then Check answers. Score is recorded; Next is always open.