git-credential-manager
Secure, cross-platform Git credential storage with authentication to GitHub, Azure Repos, and other popular Git hosting services.
Top Related Projects
Secure Git credential storage for Windows with support for Visual Studio Team Services, GitHub, and Bitbucket multi-factor authentication.
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.
A cross-platform, linkable library implementation of Git that you can use in your application.
A fork of Git containing Windows-specific patches.
Git Extensions is a standalone UI tool for managing git repositories. It also integrates with Windows Explorer and Microsoft Visual Studio (2015/2017/2019).
Quick Overview
The Git Credential Manager (GCM) is a secure and cross-platform credential helper for Git that supports various authentication methods, including username/password, personal access tokens, and multi-factor authentication. It is designed to simplify the authentication process for Git users and provide a consistent experience across different platforms.
Pros
- Secure Storage: GCM securely stores user credentials, ensuring that sensitive information is protected.
- Cross-Platform Compatibility: GCM works seamlessly across Windows, macOS, and Linux, providing a consistent user experience.
- Supports Multiple Authentication Methods: GCM supports various authentication methods, including username/password, personal access tokens, and multi-factor authentication.
- Automatic Credential Retrieval: GCM can automatically retrieve and use stored credentials, reducing the need for manual authentication.
Cons
- Complexity: The GCM project has a relatively complex codebase, which may make it challenging for some users to understand and contribute to.
- Limited Customization: While GCM provides a range of features, it may not offer the level of customization that some users might desire.
- Dependency on External Services: GCM relies on external services, such as Azure Active Directory, for certain authentication methods, which could introduce potential points of failure.
- Potential Performance Impact: Depending on the user's system and network conditions, the GCM's credential retrieval and storage processes may have a slight performance impact.
Code Examples
N/A (This is not a code library)
Getting Started
N/A (This is not a code library)
Competitor Comparisons
Secure Git credential storage for Windows with support for Visual Studio Team Services, GitHub, and Bitbucket multi-factor authentication.
Pros of Git-Credential-Manager-for-Windows
- Specifically designed for Windows, offering better integration with Windows-specific features
- Supports a wider range of authentication protocols, including Windows Integrated Authentication
- More mature project with a longer history of development and support
Cons of Git-Credential-Manager-for-Windows
- Limited to Windows platforms, lacking cross-platform compatibility
- May have a steeper learning curve for users familiar with standard Git credential helpers
- Less frequently updated compared to the newer git-credential-manager
Code Comparison
Git-Credential-Manager-for-Windows:
public class WindowsCredentialManager : ICredentialStore
{
public Credential Get(string service)
{
return CredentialManager.ReadCredential(service);
}
}
git-credential-manager:
func (s *credentialStore) Get(ctx context.Context, hostname string) (*Credential, error) {
cred, err := s.helper.Get(ctx, hostname)
if err != nil {
return nil, err
}
return cred, nil
}
The code snippets show different approaches to credential retrieval, with Git-Credential-Manager-for-Windows using C# and Windows-specific libraries, while git-credential-manager uses Go for cross-platform compatibility.
Secure, cross-platform Git credential storage with authentication to GitHub, Azure Repos, and other popular Git hosting services.
Pros of git-credential-manager
- Supports multiple authentication methods, including username/password, personal access tokens, and SSH keys.
- Provides a consistent and secure way to store and retrieve credentials across different platforms and environments.
- Integrates with various Git hosting services, such as GitHub, GitLab, and Bitbucket.
Cons of git-credential-manager
- Requires additional setup and configuration, which may be more complex for some users.
- May not be compatible with all Git clients or environments, limiting its usability in certain scenarios.
- Relies on external dependencies, such as the .NET Core runtime, which can increase the overall complexity of the solution.
Code Comparison
Here's a brief code comparison between the two repositories:
git-ecosystem/git-credential-manager:
public static int Main(string[] args)
{
try
{
return Program.Run(args);
}
catch (Exception ex)
{
Console.Error.WriteLine(ex.ToString());
return 1;
}
}
git-ecosystem/git-credential-manager:
public static int Main(string[] args)
{
try
{
return Program.Run(args);
}
catch (Exception ex)
{
Console.Error.WriteLine(ex.ToString());
return 1;
}
}
As you can see, the main entry point of the two repositories is nearly identical, with both using a Main
method to run the application.
Secure, cross-platform Git credential storage with authentication to GitHub, Azure Repos, and other popular Git hosting services.
Pros of git-credential-manager
- Supports multiple authentication methods, including username/password, personal access tokens, and SSH keys.
- Provides a consistent and secure way to store and retrieve credentials across different platforms and environments.
- Integrates with various Git hosting services, such as GitHub, GitLab, and Bitbucket.
Cons of git-credential-manager
- Requires additional setup and configuration, which may be more complex for some users.
- May not be compatible with all Git clients or environments, limiting its usability in certain scenarios.
- Relies on external dependencies, such as the .NET Core runtime, which can increase the overall complexity of the solution.
Code Comparison
Here's a brief code comparison between the two repositories:
git-ecosystem/git-credential-manager:
public static int Main(string[] args)
{
try
{
return Program.Run(args);
}
catch (Exception ex)
{
Console.Error.WriteLine(ex.ToString());
return 1;
}
}
git-ecosystem/git-credential-manager:
public static int Main(string[] args)
{
try
{
return Program.Run(args);
}
catch (Exception ex)
{
Console.Error.WriteLine(ex.ToString());
return 1;
}
}
As you can see, the main entry point of the two repositories is nearly identical, with both using a Main
method to run the application.
A cross-platform, linkable library implementation of Git that you can use in your application.
Pros of libgit2
- Comprehensive Git functionality: Provides a complete set of Git operations and features
- Language bindings: Offers bindings for multiple programming languages
- Performance: Highly optimized C implementation for efficient Git operations
Cons of libgit2
- Complexity: Steeper learning curve due to its extensive API
- Maintenance: Requires manual updates and maintenance for security patches
- Size: Larger library footprint compared to Git Credential Manager
Code Comparison
Git Credential Manager (C#):
public class GitCredential
{
public string Protocol { get; set; }
public string Host { get; set; }
public string Username { get; set; }
public string Password { get; set; }
}
libgit2 (C):
typedef struct {
char *url;
char *username;
char *password;
} git_cred_userpass_plaintext;
int git_cred_userpass_plaintext_new(
git_cred **out,
const char *username,
const char *password
);
Summary
While Git Credential Manager focuses specifically on credential management for Git operations, libgit2 provides a comprehensive Git implementation. libgit2 offers more flexibility and features but comes with increased complexity. Git Credential Manager is more specialized and easier to integrate for credential handling, while libgit2 is better suited for applications requiring full Git functionality.
A fork of Git containing Windows-specific patches.
Pros of Git for Windows
- Comprehensive Git distribution for Windows, including GUI and command-line tools
- Integrates well with Windows environment and file system
- Regular updates and maintenance from a large community
Cons of Git for Windows
- Larger installation footprint compared to Git Credential Manager
- May include unnecessary components for users who only need credential management
- Potentially more complex configuration for specific credential scenarios
Code Comparison
Git for Windows (config example):
[credential]
helper = manager
Git Credential Manager (config example):
[credential]
helper = C:/Program Files/Git Credential Manager/git-credential-manager.exe
Key Differences
- Git Credential Manager focuses specifically on credential management, while Git for Windows is a full Git distribution
- Git Credential Manager offers more advanced authentication options for various hosting providers
- Git for Windows includes a broader set of tools and features beyond credential management
Use Cases
- Choose Git for Windows for a complete Git experience on Windows systems
- Opt for Git Credential Manager when you need advanced credential management features or want a lightweight solution
Git Extensions is a standalone UI tool for managing git repositories. It also integrates with Windows Explorer and Microsoft Visual Studio (2015/2017/2019).
Pros of GitExtensions
- Comprehensive GUI for Git operations, making it easier for users who prefer visual interfaces
- Integrates with Windows Explorer and Visual Studio, enhancing workflow for Windows users
- Offers a wide range of features beyond credential management, including repository browsing and commit history visualization
Cons of GitExtensions
- Primarily focused on Windows, limiting cross-platform compatibility
- Larger application size and resource footprint due to its extensive feature set
- May have a steeper learning curve for users who only need basic Git functionality
Code Comparison
GitExtensions (C#):
public static string GetMonoVersion()
{
try
{
var p = new Process();
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.FileName = "mono";
p.StartInfo.Arguments = "--version";
p.Start();
string output = p.StandardOutput.ReadToEnd();
p.WaitForExit();
return output.Trim();
}
catch
{
return null;
}
}
Git Credential Manager (C#):
public static string GetGitVersion()
{
var psi = new ProcessStartInfo(GitExecutablePath)
{
Arguments = "version",
RedirectStandardOutput = true,
UseShellExecute = false,
};
using var process = Process.Start(psi);
string output = process.StandardOutput.ReadToEnd().Trim();
process.WaitForExit();
return output;
}
Convert
designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
Git Credential Manager
Git Credential Manager (GCM) is a secure Git credential helper built on .NET that runs on Windows, macOS, and Linux. It aims to provide a consistent and secure authentication experience, including multi-factor auth, to every major source control hosting service and platform.
GCM supports (in alphabetical order) Azure DevOps, Azure DevOps Server (formerly Team Foundation Server), Bitbucket, GitHub, and GitLab. Compare to Git's built-in credential helpers (Windows: wincred, macOS: osxkeychain, Linux: gnome-keyring/libsecret), which provide single-factor authentication support for username/password only.
GCM replaces both the .NET Framework-based Git Credential Manager for Windows and the Java-based Git Credential Manager for Mac and Linux.
Install
See the installation instructions for the current version of GCM for install options for your operating system.
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 | ✓ | ✓ |
armhf support | N/A | N/A | ✓ |
(*) GCM guarantees support only for the Linux distributions that are officially supported by dotnet.
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
See the documentation index for links to additional resources.
Experimental Features
Future features
Curious about what's coming next in the GCM project? Take a look at the project roadmap! You can find more details about the construction of the roadmap and how to interpret it here.
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.
Top Related Projects
Secure Git credential storage for Windows with support for Visual Studio Team Services, GitHub, and Bitbucket multi-factor authentication.
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.
A cross-platform, linkable library implementation of Git that you can use in your application.
A fork of Git containing Windows-specific patches.
Git Extensions is a standalone UI tool for managing git repositories. It also integrates with Windows Explorer and Microsoft Visual Studio (2015/2017/2019).
Convert
designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot