How to fix fatal: credential-manager get: failed to get credentials in Git

GitBEGINNERMEDIUMUpdated Dec 6, 2025· 427 views

This error occurs when Git Credential Manager (GCM) cannot retrieve stored credentials from Windows Credential Manager. Common causes include corrupted credential entries, misconfigured credential stores, or stale authentication tokens that need to be refreshed.

Quick fix

Fixes fatal: credential-manager get: failed to get credentials

# List credentials (PowerShell)
cmdkey /list | findstr git

# Delete a specific credential
cmdkey /delete:git:https://github.com
cmdkey /delete:git:https://dev.azure.com

# Delete all Git credentials
cmdkey /delete:LegacyGeneric:target=git:https://github.com
  1. Clear old credentials from Windows Credential Manager
  2. Update Git Credential Manager configuration
  3. Switch credential store to DPAPI
  4. Re-authenticate with your Git hosting provider
git — error
# List credentials (PowerShell)
cmdkey /list | findstr git
# Delete a specific credential
cmdkey /delete:git:https://github.com
cmdkey /delete:git:https://dev.azure.com
# Delete all Git credentials
cmdkey /delete:LegacyGeneric:target=git:https://github.com
fatal: credential-manager get: failed to get credentials

What this error means

When you see "fatal: credential-manager get: failed to get credentials", Git is telling you that it invoked Git Credential Manager to retrieve your stored authentication credentials, but GCM was unable to fetch them from the underlying credential store. Git Credential Manager (GCM) is a helper application that securely stores and retrieves credentials for HTTPS-based Git operations. On Windows, GCM typically stores credentials in Windows Credential Manager (the system's built-in credential vault). When you push, pull, or fetch from a remote repository, Git asks GCM for credentials. If GCM cannot find them or encounters an error accessing the credential store, it reports this failure. This error is distinct from authentication failures at the server level. Here, the problem is local: GCM cannot even retrieve the credentials to send to the server. The credentials may have been deleted, corrupted, or the credential store configuration may be pointing to a store that doesn't exist or isn't accessible.

Typical symptoms

  • Git push, pull, or fetch operations fail immediately with the credential error
  • The error appears after a Windows update or Git for Windows upgrade
  • Previously working Git operations suddenly fail without any remote changes
  • The error occurs after changing your Windows user password
  • Multiple Git-related credential prompts appear but operations still fail
  • Error appears when using Git from Visual Studio, VS Code, or other IDEs
  • The error message may include additional details like 'no credentials found'
  • Git operations work fine with SSH but fail with HTTPS remotes

Common causes

  1. Stored credentials in Windows Credential Manager are corrupted or expired
  2. Windows Credential Manager entries were deleted or cleared
  3. Git Credential Manager configuration points to an invalid or inaccessible store
  4. GitHub Personal Access Token (PAT) stored in credentials has expired or been revoked
  5. Windows user password was changed, invalidating DPAPI-encrypted credentials
  6. Conflict between multiple installed versions of Git Credential Manager
  7. Git configuration references an outdated credential helper name (manager-core vs manager)
  8. Antivirus or security software blocking access to Windows Credential Manager
  9. Corporate Group Policy restricting credential storage
  10. Git for Windows was updated but credential helper configuration wasn't migrated

How to fix "fatal: credential-manager get: failed to get credentials"

1Clear old credentials from Windows Credential Manager

The most common fix is to remove stale credentials and let Git prompt for new ones:

Using Windows Settings:
1. Press Windows + I to open Settings
2. Search for "Credential Manager" or go to Control Panel > User Accounts > Credential Manager
3. Click on Windows Credentials
4. Look for entries starting with git: (e.g., git:https://github.com)
5. Click each Git-related entry and select Remove
6. Also check for entries starting with ada: or containing your Git hosting provider

Using Command Line:

cmd
# List credentials (PowerShell)
cmdkey /list | findstr git

# Delete a specific credential
cmdkey /delete:git:https://github.com
cmdkey /delete:git:https://dev.azure.com

# Delete all Git credentials
cmdkey /delete:LegacyGeneric:target=git:https://github.com

After removing the credentials, run your Git command again. You'll be prompted to authenticate, and new credentials will be stored.

2Update Git Credential Manager configuration

Ensure Git is configured to use the correct credential helper:

bash
# Check current credential helper configuration
git config --list --show-origin | grep credential

# Set the credential helper to 'manager' (Git 2.39+)
git config --global credential.helper manager

# For older Git versions, use 'manager-core'
git config --global credential.helper manager-core

# If you have conflicting settings, replace all of them
git config --global credential.helper manager --replace-all

If using Azure DevOps:

bash
git config --global credential.https://dev.azure.com.useHttpPath true

Verify the helper is working:

bash
git credential-manager --version
# Should output something like: Git Credential Manager version 2.x.x
3Switch credential store to DPAPI

If the default credential store isn't working, try switching to the DPAPI store which stores credentials in encrypted files:

bash
# Configure GCM to use DPAPI store
git config --global credential.credentialStore dpapi

# Verify the setting
git config --global credential.credentialStore

The DPAPI store encrypts credentials using Windows Data Protection API and saves them to %USERPROFILE%\.gcm\dpapi_store. This can be more reliable than Windows Credential Manager in some environments.

Other available stores on Windows:
- wincredman - Windows Credential Manager (default)
- dpapi - DPAPI-encrypted files
- cache - In-memory cache (credentials lost on restart)
- plaintext - Plain text file (not recommended for security reasons)

bash
# To switch back to Windows Credential Manager
git config --global credential.credentialStore wincredman
4Re-authenticate with your Git hosting provider

Force Git Credential Manager to perform a fresh authentication:

For GitHub:

bash
# Trigger GitHub OAuth login flow
git credential-manager github login

# Or erase existing credentials and re-auth
echo "protocol=https
host=github.com" | git credential-manager erase

# Then run a Git operation to trigger new login
git fetch origin

For Azure DevOps:

bash
echo "protocol=https
host=dev.azure.com" | git credential-manager erase

git fetch origin

For GitLab:

bash
echo "protocol=https
host=gitlab.com" | git credential-manager erase

git fetch origin

When prompted, authenticate with your browser. For GitHub, you may need to:
1. Click "Authorize" in the browser popup
2. Enter your GitHub password or confirm with 2FA
3. Return to the terminal where Git should complete successfully

5Generate a new Personal Access Token

If OAuth authentication isn't working, use a Personal Access Token (PAT):

GitHub:
1. Go to [github.com/settings/tokens](https://github.com/settings/tokens)
2. Click Generate new token (classic)
3. Give it a descriptive name and expiration
4. Select scopes: repo (full control) at minimum
5. Click Generate token and copy it immediately

Azure DevOps:
1. Go to your organization's User Settings > Personal Access Tokens
2. Click New Token
3. Set scope to Code (Read & Write)
4. Create and copy the token

Store the PAT manually:

bash
# Clear old credentials first
echo "protocol=https
host=github.com" | git credential-manager erase

# Store new credentials
git credential-manager store <<EOF
protocol=https
host=github.com
username=your-username
password=ghp_yourPersonalAccessToken
EOF

Or simply run git push and enter your username and PAT when prompted.

6Reinstall Git Credential Manager

If the credential manager itself is corrupted, reinstall it:

bash
# Uninstall GCM
git credential-manager uninstall

# Reinstall GCM
git credential-manager install

# Verify installation
git credential-manager --version

If that doesn't work, reinstall Git for Windows:

1. Download the latest Git for Windows from [git-scm.com](https://git-scm.com/download/win)
2. Run the installer
3. When asked about the credential helper, select Git Credential Manager
4. Complete the installation

For Visual Studio users:
1. Open Visual Studio Installer
2. Click Modify on your Visual Studio installation
3. Go to Individual Components
4. Ensure Git for Windows is checked
5. Click Update

This ensures Visual Studio uses a compatible version of Git and GCM.

7Check for conflicting credential helpers

Multiple credential helper configurations can cause conflicts:

bash
# Show all credential settings from all config levels
git config --list --show-origin | grep credential

# Check for helpers at each level
git config --system credential.helper
git config --global credential.helper
git config --local credential.helper

If you see multiple or conflicting entries:

bash
# Clear all credential helper settings
git config --system --unset-all credential.helper
git config --global --unset-all credential.helper
git config --local --unset-all credential.helper

# Set only the global one
git config --global credential.helper manager

Check for legacy helper names:
If you see manager-core (older) or wincred (very old), update to manager:

bash
git config --global credential.helper manager

Windows config file locations to check:
- System: C:\Program Files\Git\etc\gitconfig
- Global: %USERPROFILE%\.gitconfig
- Local: .git\config in each repository

8Debug credential manager issues

Enable tracing to understand what's happening:

bash
# Enable GCM debug logging
set GCM_TRACE=1
set GIT_TRACE=1

# Run the failing command
git fetch origin

# View detailed output showing credential manager operations

Test credential manager directly:

bash
# Test credential retrieval
echo protocol=https
host=github.com | git credential-manager get

# Should output stored credentials or prompt for new ones
# If it errors here, the issue is with GCM configuration

Check GCM logs:

bash
# GCM can write logs to a file
set GCM_TRACE=%USERPROFILE%\gcm.log
git fetch origin
type %USERPROFILE%\gcm.log

The log will show exactly where in the credential retrieval process the failure occurs.

9Use SSH instead of HTTPS as a workaround

If HTTPS credential issues persist, switch to SSH authentication:

bash
# Check if you have an SSH key
ls ~/.ssh/id_ed25519.pub
# or
ls ~/.ssh/id_rsa.pub

# If not, generate one
ssh-keygen -t ed25519 -C "your_email@example.com"

Add your SSH key to GitHub:
1. Copy your public key: clip < ~/.ssh/id_ed25519.pub
2. Go to GitHub.com > Settings > SSH and GPG keys
3. Click New SSH key and paste your key

Change your remote from HTTPS to SSH:

bash
# View current remote
git remote -v
# origin  https://github.com/user/repo.git (fetch)

# Change to SSH
git remote set-url origin git@github.com:user/repo.git

# Verify the change
git remote -v
# origin  git@github.com:user/repo.git (fetch)

# Test the connection
ssh -T git@github.com

SSH uses key-based authentication instead of passwords, completely bypassing credential manager issues.

Advanced notes

### Understanding Git Credential Manager Stores

GCM supports multiple credential stores. On Windows, the default is Windows Credential Manager, but issues with it can be resolved by switching stores:

| Store | Description | Use Case |
|-------|-------------|----------|
| wincredman | Windows Credential Manager | Default, system-integrated |
| dpapi | DPAPI-encrypted files | Reliable fallback, user-specific |
| cache | Memory only | Temporary use, clears on restart |
| plaintext | Unencrypted file | Testing only, not secure |

### After Windows Password Change

If you changed your Windows password, DPAPI-encrypted credentials may become inaccessible. Clear all Git credentials from Windows Credential Manager and re-authenticate.

### Corporate/Enterprise Environments

In enterprise environments with Group Policy restrictions:

bash
# Check if credential storage is restricted
git credential-manager diagnose

# Use cache store as fallback (credentials cleared on logout)
git config --global credential.credentialStore cache
git config --global credential.cacheOptions "--timeout=86400"

### Azure DevOps Specific Issues

Azure DevOps requires the useHttpPath setting for organizations with multiple projects:

bash
git config --global credential.https://dev.azure.com.useHttpPath true

Without this, credentials for one project might be incorrectly used for another.

### Multiple GitHub Accounts

If you use multiple GitHub accounts, GCM may get confused. Use the useHttpPath setting:

bash
git config --global credential.https://github.com.useHttpPath true

This stores credentials per-repository rather than per-host.

### WSL (Windows Subsystem for Linux)

When using Git in WSL but wanting to use Windows credentials:

bash
# In WSL, configure Git to use Windows GCM
git config --global credential.helper "/mnt/c/Program\ Files/Git/mingw64/bin/git-credential-manager.exe"

### Checking Credential Manager Health

bash
# Run GCM diagnostics
git credential-manager diagnose

# Check if Windows Credential Manager service is running
sc query vaultsvc

Frequently asked questions

What does "fatal: credential-manager get: failed to get credentials" mean?
When you see "fatal: credential-manager get: failed to get credentials", Git is telling you that it invoked Git Credential Manager to retrieve your stored authentication credentials, but GCM was unable to fetch them from the underlying credential store. Git Credential Manager (GCM) is a helper application that securely stores and retrieves credentials for HTTPS-based Git operations. On Windows, GCM typically stores credentials in Windows Credential Manager (the system's built-in credential vault).
How do I fix "fatal: credential-manager get: failed to get credentials"?
This error occurs when Git Credential Manager (GCM) cannot retrieve stored credentials from Windows Credential Manager. Common causes include corrupted credential entries, misconfigured credential stores, or stale authentication tokens that need to be refreshed.
What causes "fatal: credential-manager get: failed to get credentials"?
Stored credentials in Windows Credential Manager are corrupted or expired Windows Credential Manager entries were deleted or cleared Git Credential Manager configuration points to an invalid or inaccessible store
Is the "fatal: credential-manager get: failed to get credentials" error serious?
It is a medium-severity error — more of a blocker than a risk. The steps above resolve it.

Official resources & further reading