How to Manage Multiple Git Accounts in Windows in 2026
If you’re a developer who needs to manage multiple Git accounts in Windows — a common need for freelancers, consultants, and developers who contribute to both work and open-source projects — you’ll quickly discover that Windows handles Git credentials differently from Linux and macOS. The Windows Credential Manager caches credentials globally, making multi-account Git setups confusing without proper configuration.
This guide provides a complete, tested workflow for managing multiple Git accounts on Windows, covering SSH keys, HTTPS tokens, conditional Git config, and browser-based GitHub/GitLab access.
The Core Problem: Windows Credential Manager
On Windows, Git defaults to using the Windows Credential Manager to store authentication credentials. The problem with multiple accounts:
- Credential Manager stores one credential per host (e.g., one for github.com)
- When you switch accounts and push to the same host, it uses the cached (wrong) credential
- You get “Permission denied” or “Authentication failed” errors in the wrong account’s repos
- Or worse — commits are attributed to the wrong identity silently
The solution requires configuring Git to use different credentials for different contexts. There are two main approaches: SSH keys and HTTPS with credential namespacing.
Method 1: SSH Keys (Recommended)
SSH is the cleanest, most reliable solution for managing multiple Git accounts on Windows.
Step 1: Install Git for Windows
Download from git-scm.com. During installation, select “Use bundled OpenSSH” — this gives you the ssh-keygen and ssh-agent tools needed.
Step 2: Generate SSH Keys for Each Account
Open Git Bash and generate a separate key pair per account:
# Account 1: Personal (e.g., GitHub personal) ssh-keygen -t ed25519 -C "personal@email.com" -f ~/.ssh/id_personal # Account 2: Work (e.g., GitHub work org) ssh-keygen -t ed25519 -C "work@company.com" -f ~/.ssh/id_work # Account 3: Client (e.g., GitLab client) ssh-keygen -t ed25519 -C "contractor@client.com" -f ~/.ssh/id_client
This creates key pairs in C:\Users\YourName\.ssh\. Each account gets a unique private key and public key (.pub).
Step 3: Add Public Keys to Git Hosts
Copy each public key and add it to the appropriate platform:
# Copy personal key cat ~/.ssh/id_personal.pub
- GitHub: Settings → SSH and GPG keys → New SSH key → paste
- GitLab: User Settings → SSH Keys → Add key → paste
- Bitbucket: Personal settings → SSH keys → Add key → paste
Repeat for each account on each platform.
Step 4: Configure the SSH Config File
Create or edit ~/.ssh/config (use Notepad or VS Code):
# Personal GitHub
Host github-personal
HostName github.com
User git
IdentityFile ~/.ssh/id_personal
IdentitiesOnly yes
# Work GitHub
Host github-work
HostName github.com
User git
IdentityFile ~/.ssh/id_work
IdentitiesOnly yes
# Client GitLab
Host gitlab-client
HostName gitlab.com
User git
IdentityFile ~/.ssh/id_client
IdentitiesOnly yes
The IdentitiesOnly yes line ensures SSH only tries the specified key, preventing authentication attempts with wrong keys.
Step 5: Use Custom Hosts When Cloning
# Personal repo — use github-personal alias git clone git@github-personal:personaluser/my-project.git # Work repo — use github-work alias git clone git@github-work:workorg/company-project.git # Client repo — use gitlab-client alias git clone git@gitlab-client:clientorg/client-project.git
Step 6: Fix Existing Repos
Update existing repos to use the correct SSH host alias:
# Check current remote git remote -v # Update to use correct alias git remote set-url origin git@github-personal:personaluser/existing-repo.git
Method 2: Conditional Git Config (.gitconfig)
Git’s includeIf directive automatically applies different configurations based on the directory path. This ensures every repo in your work folder uses your work identity — no manual configuration per repo needed.
Global .gitconfig (default = personal)
[user]
name = Personal Name
email = personal@email.com
# Apply work config to everything under C:/Projects/Work/
[includeIf "gitdir:C:/Projects/Work/"]
path = ~/.gitconfig-work
# Apply client config to everything under C:/Projects/ClientName/
[includeIf "gitdir:C:/Projects/ClientName/"]
path = ~/.gitconfig-client
~/.gitconfig-work
[user]
name = Work Name
email = work@company.com
~/.gitconfig-client
[user]
name = Contractor Name
email = contractor@client.com
Now any repo cloned into C:/Projects/Work/ automatically commits with your work identity. The git log will always show the correct author for each repo.
Method 3: Personal Access Tokens with HTTPS
If you prefer HTTPS over SSH, use Personal Access Tokens (PATs) as passwords:
- Generate a PAT for each account on each platform (GitHub: Settings → Developer settings → Tokens)
- When Git prompts for credentials, enter the username and use the PAT as the password
- Store PATs in the Windows Credential Manager under different namespaces
Managing HTTPS Credentials with Git Credential Manager
Git Credential Manager (GCM) supports multiple accounts per host using the credential.useHttpPath config:
# Enable per-repo credential storage git config --global credential.useHttpPath true
With this enabled, GCM stores credentials per repository URL rather than per hostname, allowing different credentials for repos on the same host.
Verifying Your Setup
Test each SSH connection after setup:
# Test personal ssh -T git@github-personal # Expected: Hi personaluser! You've successfully authenticated... # Test work ssh -T git@github-work # Expected: Hi workuser! You've successfully authenticated...
Verify commit identity in a repo:
git config user.name git config user.email
Managing Web Browser Access Across Git Accounts
Command-line Git is only part of the picture. Reviewing pull requests, managing issues, and using GitHub/GitLab Actions all happen in the browser. For browser-based access across multiple accounts:
- Chrome profiles: One profile per Git account, each signed into its own GitHub/GitLab session
- Cloud browser sessions: Send.win provides isolated sessions where each Git platform account has its own fingerprint and cookies, enabling simultaneous multi-account browser access without tab confusion
How Send.win Helps You Master Manage Multiple Git Accounts In Windows
Send.win makes Manage Multiple Git Accounts In Windows simple and secure with powerful browser isolation technology:
- Browser Isolation – Every tab runs in a sandboxed environment
- Cloud Sync – Access your sessions from any device
- Multi-Account Management – Manage unlimited accounts safely
- No Installation Required – Works instantly in your browser
- Affordable Pricing – Enterprise features without enterprise costs
Try Send.win Free – No Credit Card Required
Experience the power of browser isolation with our free demo:
- Instant Access – Start testing in seconds
- Full Features – Try all capabilities
- Secure – Bank-level encryption
- Cross-Platform – Works on desktop, mobile, tablet
- 14-Day Money-Back Guarantee
Ready to upgrade? View pricing plans starting at just $9/month.
This is especially valuable when reviewing code on different accounts simultaneously or when multiple team members need access to the same organizational repositories. Read about multi-login profiles for teams for browser-based multi-account workflows.
Common Windows-Specific Issues and Fixes
SSH Agent Not Starting Automatically
Add this to your ~/.bashrc or PowerShell profile:
# Git Bash / WSL eval "$(ssh-agent -s)" ssh-add ~/.ssh/id_personal ssh-add ~/.ssh/id_work
Or set the OpenSSH Agent service to start automatically in Windows Services.
Line Ending Issues (CRLF vs LF)
Windows uses CRLF line endings; Git hosts typically use LF. Configure per account:
# In work repos (may need Windows line endings) git config core.autocrlf true # In open-source repos (use LF for cross-platform compatibility) git config core.autocrlf input
Wrong Email in Commits After Clone
If you forgot to configure per-repo identity and committed with the wrong email:
# Fix identity for this repo git config user.email "correct@email.com" # Amend the last commit's author git commit --amend --reset-author --no-edit
Frequently Asked Questions
Can I use different Git accounts for different repos on the same computer?
Yes — the SSH config approach (different host aliases per account) or conditional .gitconfig includes both achieve this automatically based on the remote URL or repo directory location.
Does GitHub Desktop support multiple accounts on Windows?
GitHub Desktop supports signing into one account at a time. Switching requires signing out and signing in with the other account. For simultaneous multi-account workflows, use the Git CLI with SSH keys.
How do I check which Git identity will be used in a specific repo?
git config user.name && git config user.email
Run this inside the repo. If conditional includes are set up correctly, it returns the account-specific identity.
Why are my commits showing up under the wrong GitHub account?
Commits are attributed based on the email address in your Git config. If the email doesn’t match any verified email on the target GitHub account, the commit appears as an unlinked author. Ensure user.email matches a verified email on the correct GitHub account. See our guide on keeping multiple accounts isolated and properly configured.
