How to Install and Configure Microsoft Git Credential Manager for Windows

How to Install and Configure Microsoft Git Credential Manager for Windows

Overview

Microsoft Git Credential Manager (GCM) for Windows stores and manages Git credentials to streamline authentication with Git remotes (Azure DevOps, GitHub, GitLab, etc.). This guide assumes Windows ⁄11 and Git already installed.

1. Install GCM

  1. Download the latest GCM for Windows installer from the official release page:
  2. Run the downloaded installer and follow prompts. Accept defaults unless you need a custom install path.
  3. Verify installation:

    Code

    git-credential-manager-core –version

2. Enable GCM for Git

  1. Set GCM as Git’s credential helper globally:

    Code

    git config –global credential.helper manager-core
  2. Confirm Git is using GCM:

    Code

    git config –global –get credential.helper

    Expected output: manager-core

3. Authenticate with a Remote

  1. Clone or interact with a remote requiring authentication (clone, fetch, push). On first access, GCM will open a browser window for sign-in.
  2. Choose the provider (e.g., GitHub, Azure DevOps) and complete OAuth or personal access token flow.
  3. GCM stores the resulting token in the Windows Credential Manager for future use.

4. Configure provider-specific options (optional)

  • For Azure DevOps with PAT scopes, ensure scopes include Code (read/write).
  • To force use of PAT instead of OAuth, create a PAT on the provider and use:

    Code

    git credential-manager-core store

    Then follow prompts to input the URL, username, and token.

5. Troubleshooting

  • If sign-in browser doesn’t open: ensure default browser is set and OS pop-up blockers allow it.
  • If credentials fail repeatedly: clear stored credentials in Windows Credential Manager and retry.
    • Open Control Panel → Credential Manager → Windows Credentials → remove entries for your Git host.
  • Use verbose logging:

    Code

    GCMTRACE=1 git push

    Or enable logging in GCM config:

    Code

    git config –global credential.credentialStore log

6. Security notes

  • Tokens are stored in Windows Credential Manager; protect your user account and disk encryption.
  • Revoke PATs or disconnect OAuth sessions from the provider’s security settings when needed.

Quick checklist

  • Downloaded from https://aka.ms/gcm/latest
  • Ran installer and verified version
  • Set credential.helper to manager-core
  • Completed provider sign-in once to cache token
  • Cleared/retried if authentication issues occurred

If you want, I can provide exact commands for creating a PAT on GitHub or Azure DevOps, or a short script to automate install and config.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *