What is a credential helper in Git, and what problem does it solve?

Last updated 6 July 2026

  • A credential helper stores and retrieves passwords or tokens so Git doesn't prompt on every HTTPS push/fetch.

  • Options: cache (in memory, short-lived), store (plaintext on disk, insecure), or OS helpers like macOS Keychain or Windows manager (encrypted).

  • Configure with git config --global credential.helper <helper>.

  • https://www.kernel.org/pub/software/scm/git/docs/git-credential.html
  • https://man7.org/linux/man-pages/man7/gitcredentials.7.html
  • https://git-scm.com/book/en/v2/Git-Tools-Credential-Storage
  • https://confluence.atlassian.com/bitbucketserver104/permanently-authenticating-with-git-repositories-1822590837.html
  • https://usethis.r-lib.org/articles/git-credentials.html
  • https://forum.sublimetext.com/t/caching-a-personal-access-token-authentication/60260
  • https://git-scm.com/docs/git-credential-store
  • https://docs.github.com/en/get-started/git-basics/caching-your-github-credentials-in-git
All Git interview questions