{"record":{"id":"b06688506818d9bb","repo":"git-ecosystem/git-credential-manager","slug":"no-credential-store-has-been-selected-unknown-c","errorCode":null,"errorMessage":"No credential store has been selected. / Unknown credential store '{credStoreName}'.\nSet the {GCM_CREDENTIAL_STORE} environment variable or the {credential}.{credentialStore} Git configuration setting to one of the following options: ...","messagePattern":"No credential store has been selected\\. / Unknown credential store '(.+?)'\\.\nSet the (.+?) environment variable or the (.+?)\\.(.+?) Git configuration setting to one of the following options: \\.\\.\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/Core/CredentialStore.cs","lineNumber":139,"sourceCode":"                    _backingStore = new NullCredentialStore();\n                    break;\n\n                default:\n                    var sb = new StringBuilder();\n                    sb.AppendLine(string.IsNullOrWhiteSpace(credStoreName)\n                        ? \"No credential store has been selected.\"\n                        : $\"Unknown credential store '{credStoreName}'.\");\n                    _context.Trace2.WriteError(sb.ToString());\n                    sb.AppendFormat(\n                        \"{3}Set the {0} environment variable or the {1}.{2} Git configuration setting to one of the following options:{3}{3}\",\n                        Constants.EnvironmentVariables.GcmCredentialStore,\n                        Constants.GitConfiguration.Credential.SectionName,\n                        Constants.GitConfiguration.Credential.CredentialStore,\n                        Environment.NewLine);\n                    AppendAvailableStoreList(sb);\n                    sb.AppendLine();\n                    sb.AppendLine($\"See {Constants.HelpUrls.GcmCredentialStores} for more information.\");\n                    throw new Exception(sb.ToString());\n            }\n        }\n\n        private static string GetDefaultStore()\n        {\n            if (PlatformUtils.IsWindows())\n                return StoreNames.WindowsCredentialManager;\n\n            if (PlatformUtils.IsMacOS())\n                return StoreNames.MacOSKeychain;\n\n            // Other platforms have no default store\n            return null;\n        }\n\n        private static void AppendAvailableStoreList(StringBuilder sb)\n        {\n            if (PlatformUtils.IsWindows())","sourceCodeStart":121,"sourceCodeEnd":157,"githubUrl":"https://github.com/git-ecosystem/git-credential-manager/blob/e8ce762cd04b4100ae637b5fbf39ef9d0a96561e/src/Core/CredentialStore.cs#L121-L157","documentation":"CredentialStore.EnsureBackingStore selects the backing credential store from the GCM_CREDENTIAL_STORE environment variable or the credential.credentialStore Git config. When no store is selected (or the value names none of the known stores: wincredman, dpapi, plaintext, secretservice, gpg, keychain, cache), it builds a message listing the available options plus a help URL and throws.","triggerScenarios":"Any store operation (Name, MaxCredentialSize, GetAccounts, Get, AddOrUpdate, Remove) triggers EnsureBackingStore; it throws when neither GCM_CREDENTIAL_STORE nor credential.credentialStore is set to a recognized store name on the current platform, or the value is an unknown string.","commonSituations":"Fresh Linux/macOS installs where no credential store was chosen; typos like `credentialStore=windowscred` or `credential.store=plaintext1`; copying Windows config to Linux; removing a previously available store (e.g. secret-service dependencies) so the default no longer resolves.","solutions":["Set `git config --global credential.credentialStore <store>` to one of the listed valid options (e.g. gpg, secret-service, keychain, cache, plaintext).","Or export GCM_CREDENTIAL_STORE=<store> in your environment.","Fix the typo/invalid value in the existing setting to match an exact supported store name.","Consult the help URL in the message (GcmCredentialStores doc) for platform-appropriate choices.","On Linux, ensure the chosen store's dependencies (e.g. libsecret, gpg) are installed before selecting it."],"exampleFix":"// before (unrecognized/absent setting)\ngit config --global credential.credentialStore windowscredman   // typo, non-Windows default\n\n// after\ngit config --global credential.credentialStore gpg   // valid store for Linux","handlingStrategy":"validation","validationCode":"var valid = new[] { \"wincredman\", \"dpapi\", \"plaintext\", \"secretservice\", \"gpg\", \"keychain\", \"cache\" };\nvar configured = Environment.GetEnvironmentVariable(\"GCM_CREDENTIAL_STORE\")\n    ?? \"$(git config --global credential.credentialStore)\".Trim();\nif (string.IsNullOrWhiteSpace(configured) || !valid.Contains(configured.ToLowerInvariant()))\n    throw new InvalidOperationException($\"Select a valid credential store; configured='{configured}'\");","typeGuard":null,"tryCatchPattern":"try\n{\n    var account = credentialStore.Get(serviceName);\n}\ncatch (Exception ex) when (ex.Message.Contains(\"No credential store has been selected\") || ex.Message.Contains(\"Unknown credential store\"))\n{\n    // configure GCM_CREDENTIAL_STORE or credential.credentialStore, then retry\n}","preventionTips":["Set credential.credentialStore explicitly on every machine you use GCM.","Match store names exactly against the list printed in the error.","Don't blindly copy Windows gitconfig to Linux/macOS.","Re-check the setting after GCM upgrades or platform migrations."],"tags":["git","credential-store","configuration","invalid-value"],"backgroundTag":"invalid-config-value","analyzedSha":"e8ce762cd04b4100ae637b5fbf39ef9d0a96561e","analyzedAt":"2026-09-11T17:15:08.753Z","contentChangedAt":"2026-09-11T17:15:08.753Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}