Git Credential Manager: "fatal: No credential store has been selected"
Git Credential Manager (GCM) keeps the sign-in it gets from Azure Repos in a credential store, and on Linux it comes without a default one (its credential stores page: "GCM comes without a default store on Linux distributions"). Until you choose a store, the first Git command that needs a sign-in stops with this message. On a desktop with a graphical session choose secretservice; on a server with no screen choose gpg (with pass) or cache.
What it looks like
fatal: No credential store has been selected.
(Older versions: "No credential backing store has been selected.")
The message goes on to tell you to set the GCM_CREDENTIAL_STORE environment variable or the credential.credentialStore Git setting to one of the store names, as described in a 2021 write-up of the same message. Nothing is wrong with your account or your token: GCM does not know where to put the sign-in. On Windows the default is wincredman and on macOS keychain (configuration), so this is a Linux message.
Git's sign-in can also feed the review list: Azure DevOps Pull Requests, a plugin for JetBrains IDEs, can ask Git for the sign-in it keeps for an Azure DevOps Services organization, or use its own personal access token instead.
Pick a store
| Value | What it is | Fits |
|---|---|---|
secretservice | The Linux Secret Service API (libsecret), for example GNOME Keyring | A desktop with a graphical session; unlocking the keyring shows a window |
gpg | GPG-encrypted files that pass can read | A server or a terminal-only machine, when you have a GPG key |
cache | Git's in-memory credential cache | A short-lived or shared machine; the sign-in is forgotten after a timeout (900 seconds by default) |
plaintext | Unencrypted files | Last resort; the credentials are readable by anyone who can read your files |
Set the one you chose once, for your user:
git config --global credential.helper manager git config --global credential.credentialStore secretservice
For gpg, the pass store has to be set up first with your GPG key ID (gpg --gen-key makes a key if you have none; gpg --list-keys shows the ID):
git config --global credential.credentialStore gpg pass init <gpg-id>
For cache, with the timeout in seconds changed from 900 to 300 as an example:
git config --global credential.credentialStore cache git config --global credential.cacheOptions "--timeout 300"
The environment variable GCM_CREDENTIAL_STORE does the same for one shell and wins over the Git setting:
export GCM_CREDENTIAL_STORE=secretservice
Then sign in once
The next command that needs the remote starts the sign-in. For Azure Repos, GCM 3.0 and later signs in with Microsoft Entra OAuth tokens by default instead of creating personal access tokens (what changed in 3.0); on a machine with no browser, set credential.msauthFlow to devicecode if the browser sign-in cannot open. Check that GCM stored it:
git ls-remote https://dev.azure.com/contoso/Project/_git/repo git-credential-manager azure-repos list
The second command lists the account GCM remembers for each organization. If the first one still asks for a user name in a terminal, GCM is not the credential helper: git config --show-origin --get-regexp credential shows what Git uses.
If you would rather not store anything
With cache nothing is written to disk, and GCM forgets the sign-in after the timeout. On a machine that no one signs in to, such as a pipeline agent or a throwaway container, there is also no one to answer a prompt; what Git does then is described under "could not read Username".
In the IDE
Azure DevOps Pull Requests, a plugin by Lesstep for JetBrains IDEs 2024.1 or later and Android Studio, has the setting "Use Git's sign-in (Git Credential Manager) instead of a token". When it is on, the plugin runs git credential fill for the organization of your remote, with all of Git's prompts and windows turned off, and keeps the answer in memory only. It does this for Azure DevOps Services over https, not for Azure DevOps Server or SSH remotes. If Git has no sign-in it can give without asking, which is the case on Linux until GCM has a store and a first sign-in, the plugin says "Git has no sign-in for … that it can give without asking" and suggests fetching or pulling over https once, or a personal access token. Git itself in the IDE (pull, push, checkout) needs the store for the same reason. The review inbox is free; voting, commenting and completing are Pro, with a 30-day trial.
Get it on JetBrains Marketplace
Azure DevOps and Microsoft Entra are trademarks of Microsoft Corporation; IntelliJ IDEA and Rider are trademarks of JetBrains s.r.o. This page is not affiliated with or endorsed by Microsoft, JetBrains or the Git Credential Manager project.
More: Git Credential Manager 3.0 and Azure Repos · Git "Authentication failed" · "could not read Username" · 日本語