git-ecosystem/git-credential-manager · error · Exception

Can only use the ' ' credential store on POSIX systems. See…

Error message

Can only use the '{StoreNames.Gpg}' credential store on POSIX systems.
See {Constants.HelpUrls.GcmCredentialStores} for more information.

What it means

ValidateGpgPass throws this Exception when the credential store is set to '{gpg}' (the pass-style GPG-encrypted store) but the host is not a POSIX system (i.e., Windows). The GPG/pass backing store relies on POSIX tooling and paths, so GCM rejects it during EnsureBackingStore.

Solutions

  1. Use 'wincredman' (Windows Credential Manager) as the store on Windows.
  2. Remove the credential.store override so GCM picks the platform default.
  3. If GPG-backed storage is required on Windows, use GCM's Windows store or run under WSL where POSIX applies.

Example fix

// before (Windows .gitconfig)
[credential]
	store = gpg
// after
[credential]
	store = wincredman
Defensive patterns

Strategy: validation

Validate before calling

if (storeType === 'gpg' && process.platform === 'win32') {
  throw new Error('gpg credential store requires a POSIX system');
}

Type guard

const supportsGpgStore = (platform: string) => platform !== 'win32';

Prevention

When it happens

Trigger: Setting credential.store / GCM_CREDENTIAL_STORE to StoreNames.Gpg on Windows; EnsureBackingStore invokes ValidateGpgPass and PlatformUtils.IsPosix() is false.

Common situations: Following Unix-oriented pass/GCM tutorials on Windows; shared dotfiles applying the same credential.store to Windows and Linux machines.

Understand the failure class

Background: "unsupported platform" / "not supported on this platform" errors: what they mean and how to fix them — this error's family across 47 libraries.

Related errors


AI-assisted analysis of git-ecosystem/git-credential-manager@e8ce762cd0 (2026-09-11). Data as JSON: /api/errors/b4a5d23910a9347f. Report an issue: GitHub.

Appendix: source

Thrown at src/Core/CredentialStore.cs:280

            }

            if (!_context.SessionManager.IsDesktopSession)
            {
                var message = $"Cannot use the '{StoreNames.SecretService}' credential backing store without a graphical interface present.";
                _context.Trace2.WriteError(message);
                throw new Exception(message + Environment.NewLine +
                                    $"See {Constants.HelpUrls.GcmCredentialStores} for more information."
                );
            }
        }

        private void ValidateGpgPass(out string storeRoot, out string execPath)
        {
            if (!PlatformUtils.IsPosix())
            {
                var message = $"Can only use the '{StoreNames.Gpg}' credential store on POSIX systems.";
                _context.Trace2.WriteError(message);
                throw new Exception(message + Environment.NewLine +
                                    $"See {Constants.HelpUrls.GcmCredentialStores} for more information."
                );
            }

            execPath = GetGpgPath();

            // If we are in a headless environment, and don't have the GPG_TTY or SSH_TTY
            // variables set, then error - we need a TTY device path for pin-entry to work headless.
            if (!_context.SessionManager.IsDesktopSession &&
                !_context.Environment.Variables.ContainsKey("GPG_TTY") &&
                !_context.Environment.Variables.ContainsKey("SSH_TTY"))
            {
                var message = "GPG_TTY is not set; add `export GPG_TTY=$(tty)` to your profile.";
                _context.Trace2.WriteError(message);
                throw new Exception(message + Environment.NewLine +
                                    $"See {Constants.HelpUrls.GcmCredentialStores} for more information."
                );
            }

View on GitHub (pinned to e8ce762cd0)