Skip to main content

Git Credential Helper

Git does not handle credentials directly. Instead, it relies on external "credential helpers" to store and retrieve credentials securely to access private repositories or other resources. This design allows Git to be flexible and integrate with various credential storage solutions across different platforms.

tip

TL;DR:

  • git-credential-manager (GCM) is the modern recommendation — it runs on Windows, macOS, and Linux, and supports multi-factor auth for GitHub, GitLab, Bitbucket, and Azure DevOps, whereas the OS-native helpers only handle username/password.
  • osxkeychain is perfectly fine if you're macOS-only and don't need OAuth browser flows.
  • cache is the right call when you have no secure storage available — e.g. ephemeral CI containers where you just need credentials to survive one pipeline run.
  • store should be a last resort — plaintext on disk is barely better than typing every time.

List of Helpers

🍎 = macOS, 🐧 = Linux, 🪟 = Windows

HelperPlatformStorageSecurityNotes
cache🍎 🐧In-memory (Unix socket)✅ Never touches diskBuilt-in, Default timeout 15 min, configurable. Not available on Windows
store🍎 🐧 🪟Plaintext file (~/.git-credentials)⚠️ UnencryptedBuilt-in, File-permission protected only. Last resort
osxkeychain🍎macOS Keychain✅ AES-256, login-key derivedDefault on macOS.
wincred🪟Windows Credential Manager✅ OS-encryptedBundled with Git for Windows. Legacy, superseded by GCM
gnome-libsecret🐧 (GNOME)GNOME Keyring / libsecret✅ OS-encryptedReplaces older gnome-keyring helper
kwallet🐧 (KDE)KWallet✅ OS-encryptedKDE desktop environments

Cross-platform (third-party, install separately):

HelperPlatformStorageOAuth supportNotes
git-credential-manager (GCM)🍎 🐧 🪟OS keychain per platform✅ YesThe modern default. Replaces wincred. Supports GitHub, GitLab, Bitbucket, Azure DevOps
oauth (git-credential-oauth)🍎 🐧 🪟OS keychain✅ YesLightweight OAuth-only alternative to GCM. Common in Linux distro packages
gopass🍎 🐧 🪟gopass password store (GPG-encrypted)Good for teams sharing credentials via GPG
1password🍎 🐧 🪟1Password vaultRequires 1Password desktop app running
lastpass🍎 🐧 🪟LastPass vaultRequires LastPass CLI