Skip to content

mminns/Git-Credential-Manager

 
 

Repository files navigation

Git Credential Manager

Build Status


Git Credential Manager (GCM) is a secure Git credential helper built on .NET that runs on Windows, macOS, and Linux.

Compared to Git's built-in credential helpers (Windows: wincred, macOS: osxkeychain, Linux: gnome-keyring/libsecret) which provides single-factor authentication support working on any HTTP-enabled Git repository, GCM provides multi-factor authentication support for Azure DevOps, Azure DevOps Server (formerly Team Foundation Server), GitHub, Bitbucket, and GitLab.

Git Credential Manager (GCM) replaces the .NET Framework-based Git Credential Manager for Windows (GCM), and the Java-based Git Credential Manager for Mac and Linux (Java GCM), providing a consistent authentication experience across all platforms.

Current status

Git Credential Manager is currently available for Windows, macOS, and Linux*. GCM only works with HTTP(S) remotes; you can still use Git with SSH:

Feature Windows macOS Linux*
Installer/uninstaller
Secure platform credential storage (see more)
Multi-factor authentication support for Azure DevOps
Two-factor authentication support for GitHub
Two-factor authentication support for Bitbucket
Two-factor authentication support for GitLab
Windows Integrated Authentication (NTLM/Kerberos) support N/A N/A
Basic HTTP authentication support
Proxy support
amd64 support
x86 support N/A
arm64 support best effort best effort, no packages
armhf support N/A N/A best effort, no packages

(*) GCM guarantees support for the below Linux distributions. GCM maintainers also monitor and evaluate issues opened against other distributions to determine community interest/engagement and whether an emerging platform should become fully-supported.

  • Debian/Ubuntu/Linux Mint
  • Fedora/CentOS/RHEL
  • Alpine

Download and Install

macOS Homebrew

The preferred installation mechanism is using Homebrew; we offer a Cask in our custom Tap.

To install, run the following:

brew tap microsoft/git
brew install --cask git-credential-manager-core

After installing you can stay up-to-date with new releases by running:

brew upgrade git-credential-manager-core

Git Credential Manager for Mac and Linux (Java-based GCM)

If you have an existing installation of the 'Java GCM' on macOS and you have installed this using Homebrew, this installation will be unlinked (brew unlink git-credential-manager) when GCM is installed.

Uninstall

To uninstall, run the following:

brew uninstall --cask git-credential-manager-core

macOS Package

We also provide a .pkg installer with each release. To install, double-click the installation package and follow the instructions presented.

Uninstall

To uninstall, run the following:

sudo /usr/local/share/gcm-core/uninstall.sh

Linux

Ubuntu/Debian distributions

Download the latest .deb package, and run the following:

sudo dpkg -i <path-to-package>
git-credential-manager-core configure

Note: Although packages were previously offered on certain Microsoft Ubuntu package feeds, GCM no longer publishes to these repositories. Please install the Debian package using the above instructions instead.

To uninstall:

git-credential-manager-core unconfigure
sudo dpkg -r gcmcore

Other distributions

Option 1: Tarball

Download the latest tarball, and run the following:

tar -xvf <path-to-tarball> -C /usr/local/bin
git-credential-manager-core configure

To uninstall:

git-credential-manager-core unconfigure
rm $(command -v git-credential-manager-core)

Option 2: Install from source helper script

  1. Ensure curl is installed:

    curl --version

    If curl is not installed, please use your distribution's package manager to install it.

  2. Download and run the script:

    curl -LO https://aka.ms/gcm/linux-install-source.sh &&
    sh ./linux-install-source.sh &&
    git-credential-manager-core configure

    Note: You will be prompted to enter your credentials so that the script can download GCM's dependencies using your distribution's package manager.

To uninstall:

Follow these instructions for your distribution.

Note: all Linux distributions require additional configuration to use GCM.


Windows

GCM is included with Git for Windows, and the latest version is included in each new Git for Windows release. This is the preferred way to install GCM on Windows. During installation you will be asked to select a credential helper, with GCM being set as the default.

image

Standalone installation

You can also download the latest installer for Windows to install GCM standalone.

⚠️ Important ⚠️

Installing GCM as a standalone package on Windows will forcibly override the version of GCM that is bundled with Git for Windows, even if the version bundled with Git for Windows is a later version.

There are two flavors of standalone installation on Windows:

  • User (preferred) (gcmuser-win*):

    Does not require administrator rights. Will install only for the current user and updates only the current user's Git configuration.

  • System (gcm-win*):

    Requires administrator rights. Will install for all users on the system and update the system-wide Git configuration.

To install, double-click the desired installation package and follow the instructions presented.

Uninstall (Windows 10)

To uninstall, open the Settings app and navigate to the Apps section. Select "Git Credential Manager" and click "Uninstall".

Uninstall (Windows 7-8.1)

To uninstall, open Control Panel and navigate to the Programs and Features screen. Select "Git Credential Manager" and click "Remove".

Windows Subsystem for Linux (WSL)

Git Credential Manager can be used with the Windows Subsystem for Linux (WSL) to enable secure authentication of your remote Git repositories from inside of WSL.

Please see the GCM on WSL docs for more information.

Supported Git versions

Git Credential Manager tries to be compatible with the broadest set of Git versions (within reason). However there are some know problematic releases of Git that are not compatible.

  • Git 1.x

    The initial major version of Git is not supported or tested with GCM.

  • Git 2.26.2

    This version of Git introduced a breaking change with parsing credential configuration that GCM relies on. This issue was fixed in commit 12294990 of the Git project, and released in Git 2.27.0.

How to use

Once it's installed and configured, Git Credential Manager is called implicitly by Git. You don't have to do anything special, and GCM isn't intended to be called directly by the user. For example, when pushing (git push) to Azure DevOps, Bitbucket, or GitHub, a window will automatically open and walk you through the sign-in process. (This process will look slightly different for each Git host, and even in some cases, whether you've connected to an on-premises or cloud-hosted Git host.) Later Git commands in the same repository will re-use existing credentials or tokens that GCM has stored for as long as they're valid.

Read full command line usage here.

Configuring a proxy

See detailed information here.

Additional Resources

Experimental Features

Contributing

This project welcomes contributions and suggestions. See the contributing guide to get started.

This project follows GitHub's Open Source Code of Conduct.

License

We're MIT licensed. When using GitHub logos, please be sure to follow the GitHub logo guidelines.

About

Secure, cross-platform Git credential storage with authentication to GitHub, Azure Repos, and other popular Git hosting services.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 97.7%
  • Shell 1.5%
  • Other 0.8%