Convert Figma logo to code with AI

microsoft logoGit-Credential-Manager-for-Windows

Secure Git credential storage for Windows with support for Visual Studio Team Services, GitHub, and Bitbucket multi-factor authentication.

2,890
594
2,890
82

Top Related Projects

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

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

9,898

A cross-platform, linkable library implementation of Git that you can use in your application.

Quick Overview

Git Credential Manager for Windows (GCM) is a secure Git credential helper built on .NET that runs on Windows. It provides authentication support for Visual Studio Team Services, Team Foundation Server, GitHub, and Bitbucket. GCM simplifies the authentication process for developers using Git on Windows.

Pros

  • Seamless integration with popular Git hosting services
  • Enhanced security through encrypted credential storage
  • Supports multi-factor authentication
  • Reduces the need for manual credential input

Cons

  • Limited to Windows operating systems
  • May require additional setup for some Git hosting services
  • Potential conflicts with other credential helpers if not configured properly
  • Regular updates needed to maintain compatibility with evolving Git services

Getting Started

  1. Download the latest installer from the releases page
  2. Run the installer and follow the prompts
  3. Open a command prompt and run:
git config --global credential.helper manager
  1. When pushing or pulling from a Git repository, GCM will handle authentication automatically

Note: For detailed configuration options and troubleshooting, refer to the project's documentation.

Competitor Comparisons

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

Pros of Git Credential Manager

  • Cross-platform support (Windows, macOS, Linux)
  • More active development and frequent updates
  • Broader integration with various Git hosting services

Cons of Git Credential Manager

  • Potentially more complex setup process
  • May require additional dependencies
  • Larger codebase, which could lead to more maintenance overhead

Code Comparison

Git Credential Manager:

public class CredentialStore : ICredentialStore
{
    public Task<ICredential> Get(string service, string account)
    {
        // Implementation
    }
}

Git-Credential-Manager-for-Windows:

public class CredentialStore : ICredentialStore
{
    public Credential Get(string target)
    {
        // Implementation
    }
}

The code snippets show similar credential store implementations, but Git Credential Manager uses async/await pattern and has a more granular approach with separate service and account parameters.

Both projects aim to simplify Git credential management, but Git Credential Manager offers broader platform support and more frequent updates. However, it may require a more complex setup and have a larger codebase. The choice between the two depends on specific requirements, such as platform compatibility and desired features.

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

Pros of Git Credential Manager

  • Cross-platform support (Windows, macOS, Linux)
  • More active development and frequent updates
  • Broader integration with various Git hosting services

Cons of Git Credential Manager

  • Potentially more complex setup process
  • May require additional dependencies
  • Larger codebase, which could lead to more maintenance overhead

Code Comparison

Git Credential Manager:

public class CredentialStore : ICredentialStore
{
    public Task<ICredential> Get(string service, string account)
    {
        // Implementation
    }
}

Git-Credential-Manager-for-Windows:

public class CredentialStore : ICredentialStore
{
    public Credential Get(string target)
    {
        // Implementation
    }
}

The code snippets show similar credential store implementations, but Git Credential Manager uses async/await pattern and has a more granular approach with separate service and account parameters.

Both projects aim to simplify Git credential management, but Git Credential Manager offers broader platform support and more frequent updates. However, it may require a more complex setup and have a larger codebase. The choice between the two depends on specific requirements, such as platform compatibility and desired features.

9,898

A cross-platform, linkable library implementation of Git that you can use in your application.

Pros of libgit2

  • Cross-platform library for Git operations, usable in multiple programming languages
  • Provides a comprehensive API for Git functionality, allowing deep integration into applications
  • Actively maintained with regular updates and improvements

Cons of libgit2

  • Requires more setup and integration effort compared to Git Credential Manager for Windows
  • Not specifically designed for credential management, requiring additional work for secure authentication

Code Comparison

Git Credential Manager for Windows (C#):

public class CredentialStore : ICredentialStore
{
    public Credential Get(string service, string account)
    {
        // Retrieve credentials from Windows Credential Manager
    }
}

libgit2 (C):

int git_cred_userpass(
    git_cred **out,
    const char *url,
    const char *user_from_url,
    unsigned int allowed_types,
    void *payload)
{
    // Implement custom credential retrieval logic
}

The code snippets illustrate the difference in approach. Git Credential Manager for Windows provides a higher-level abstraction for credential management, while libgit2 requires more manual implementation of credential handling.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

Git Credential Manager for Windows

GitHub Release Build status Coverity Scan Build Status GitHub Downloads @MicrosoftGit on Twitter


NOTICE: This project is no longer being maintained. :warning:

Git Credential Manager for Windows is no longer being maintained. The cross-platform Git Credential Manager Core (GCM Core) is the official replacement.

GCM Core is included as an optional component of Git for Windows 2.28 and will be made the default credential helper as of Git for Windows 2.29. GCM Core can also be manually installed from this page.


NOTICE: Experiencing GitHub push/fetch problems?

GitHub will disable password-based authentication on APIs Git Credential Manager for Windows uses to create tokens. As a result, GCM for Windows will no longer be able to create new access tokens for GitHub.

Git Credential Manager Core (GCM Core) supports OAuth-based authentication with GitHub and is the replacement for GCM for Windows.

Please update to Git for Windows 2.28 and select "Git Credential Manager Core" from the installer when asked to "select a credential helper", or manually install GCM Core from here.


As of 22 Feb 2018, GitHub has disabled support for weak encryption which means many users will suddenly find themselves unable to authenticate using a Git for Windows which (impacts versions older than v2.16.0). DO NOT PANIC, there's a fix. Update Git for Windows to the latest (or at least v2.16.0).

The most common error users see looks like:

fatal: HttpRequestException encountered.
   An error occurred while sending the request.
fatal: HttpRequestException encountered.
   An error occurred while sending the request.
Username for 'https://github.com':

If, after updating Git for Windows, you are still having problems authenticating with GitHub, please read this Developer Community topic which contains additional remedial actions you can take to resolve the problem.

If you are experiencing issue when using Visual Studio, please read Unable to connect to GitHub with Visual Studio.


The Git Credential Manager for Windows (GCM) provides secure Git credential storage for Windows. It's the successor to the Windows Credential Store for Git (git-credential-winstore), which is no longer maintained. Compared to Git's built-in credential storage for Windows (wincred), which provides single-factor authentication support working on any HTTP enabled Git repository, GCM provides multi-factor authentication support for Azure DevOps, Team Foundation Server, GitHub, and Bitbucket.

This project includes:

  • Secure password storage in the Windows Credential Store.
  • Multi-factor authentication support for Azure DevOps.
  • Two-factor authentication support for GitHub.
  • Two-factor authentication support for Bitbucket.
  • Personal Access Token generation and usage support for Azure DevOps, GitHub, and Bitbucket.
  • Non-interactive mode support for Azure DevOps backed by Azure Directory.
  • NTLM/Kerberos authentication for Team Foundation Server (see notes).
  • Optional settings for build agent optimization.

Community

This is a community project so feel free to contribute ideas, submit bugs, fix bugs, or code new features. For detailed information on how the GCM works go to the wiki.

Download and Install

To use the GCM, you can download the latest installer. To install, double-click GCMW-{version}.exe and follow the instructions presented.

When prompted to select your terminal emulator for Git Bash you should choose the Windows' default console window, or make sure GCM is configured to use modal dialogs. GCM cannot prompt you for credentials, at the console, in a MinTTY setup.

Manual Installation

Note for users with special installation needs, you can still extract the gcm-{version}.zip file and run install.cmd from an administrator command prompt. This allows specification of the installation options explained below.

Installation in an MSYS2 Environment

To use the GCM along with git installed with pacman in an MSYS2 environment, simply download a release zip and extract the contents directly into C:\msys64\usr\lib\git-core (assuming your MSYS2 environment is installed in C:\msys64). Then run:

git config --global credential.helper manager

How to use

You don't. It magically works when credentials are needed. For example, when pushing to Azure DevOps, it automatically opens a window and initializes an oauth2 flow to get your token.

Build and Install from Sources

To build and install the GCM yourself, clone the sources, open the solution file in Visual Studio, and build the solution. All necessary components will be copied from the build output locations into a .\Deploy folder at the root of the solution. From an elevated command prompt in the .\Deploy folder issue the following command git-credential-manager install. Additional information about development and debugging are available in our documents area.

Various options are available for uniquely configured systems, like automated build systems. For systems with a non-standard placement of Git use the --path <git> parameter to supply where Git is located and thus where the GCM should be deployed to. For systems looking to avoid checking for the Microsoft .NET Framework and other similar prerequisites use the --force option. For systems looking for silent installation without any prompts, use the --passive option.

Additional Resources

Contribute

There are many ways to contribute.

  • Submit bugs and help us verify fixes as they are checked in.
  • Review code changes.
  • Contribute bug fixes and features.

Code Contributions

For code contributions, you will need to complete a Contributor License Agreement (CLA). Briefly, this agreement testifies that you grant us permission to use the submitted change according to the terms of the project's license, and that the work being submitted is under the appropriate copyright.

Please submit a Contributor License Agreement (CLA) before submitting a pull request. You may visit https://cla.microsoft.com to sign digitally. Alternatively, download the agreement Microsoft Contribution License Agreement.pdf, sign, scan, and email it back to cla@microsoft.com. Be sure to include your GitHub user name along with the agreement. Once we have received the signed CLA, we'll review the request.

Code of Conduct

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

License

This project uses the MIT License.