How to Manage Multiple GitHub Accounts: The Developer’s Complete Guide
Managing multiple GitHub accounts is one of the most common — and most frustrating — developer workflows. Maybe you have a personal GitHub for open-source contributions and a company GitHub for work. Maybe you freelance for multiple clients who each require separate GitHub organizations. Or maybe you maintain separate identities for security research, open-source contributions, and your day job.
Whatever the reason, GitHub’s default setup assumes one account per person. This guide shows you how to github manage multiple accounts cleanly using SSH keys, Git credential manager, browser profiles, and CLI tools — without accidentally pushing personal code to a work repo or vice versa.
Why Developers Need Multiple GitHub Accounts
- Work/personal separation — company IP policies often require using a company-owned GitHub account for work code
- Freelance/client work — clients may require contributors to use organization-specific accounts
- Open-source privacy — contributing under a pseudonym for privacy or safety
- Side projects — keeping personal brand separate from employer
- Security research — maintaining separate identities for responsible disclosure
- Bot/automation accounts — CI/CD service accounts that need their own credentials
Method 1: SSH Key Configuration (Most Common)
Overview
The most reliable way to manage multiple GitHub accounts on one machine is through SSH keys. Each GitHub account gets its own SSH keypair, and your SSH config file routes connections to the correct key based on a hostname alias.
Step-by-Step Setup
1. Generate SSH Keys
Create a separate SSH key for each GitHub account:
# Personal account
ssh-keygen -t ed25519 -C "personal@email.com" -f ~/.ssh/id_ed25519_personal
# Work account
ssh-keygen -t ed25519 -C "work@company.com" -f ~/.ssh/id_ed25519_work
# Freelance account
ssh-keygen -t ed25519 -C "freelance@email.com" -f ~/.ssh/id_ed25519_freelance
2. Add Keys to SSH Agent
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519_personal
ssh-add ~/.ssh/id_ed25519_work
ssh-add ~/.ssh/id_ed25519_freelance
3. Add Public Keys to GitHub Accounts
For each account, go to GitHub → Settings → SSH and GPG keys → New SSH key, and paste the corresponding public key content (cat ~/.ssh/id_ed25519_personal.pub).
4. Configure SSH Config File
This is the critical part. Create or edit ~/.ssh/config:
# Personal GitHub
Host github.com-personal
HostName github.com
User git
IdentityFile ~/.ssh/id_ed25519_personal
IdentitiesOnly yes
# Work GitHub
Host github.com-work
HostName github.com
User git
IdentityFile ~/.ssh/id_ed25519_work
IdentitiesOnly yes
# Freelance GitHub
Host github.com-freelance
HostName github.com
User git
IdentityFile ~/.ssh/id_ed25519_freelance
IdentitiesOnly yes
5. Clone Repos Using Host Aliases
# Clone personal repo
git clone git@github.com-personal:username/repo.git
# Clone work repo
git clone git@github.com-work:company/repo.git
# Clone freelance repo
git clone git@github.com-freelance:client/repo.git
6. Verify Connection
ssh -T git@github.com-personal
# Output: Hi personal-username! You've successfully authenticated...
ssh -T git@github.com-work
# Output: Hi work-username! You've successfully authenticated...
Method 2: Git Credential Manager
For HTTPS Users
If you prefer HTTPS over SSH (or your company requires it), Git Credential Manager (GCM) can handle multiple GitHub accounts. GCM stores credentials securely and supports multi-account workflows.
Install GCM
# macOS (via Homebrew)
brew install git-credential-manager
# Windows (usually bundled with Git for Windows)
# Linux
wget https://github.com/git-ecosystem/git-credential-manager/releases/latest -O gcm.deb
sudo dpkg -i gcm.deb
Configure Per-Directory Credentials
Set up GCM to use different credentials based on the repository directory:
# In ~/work/ directories, use work account
git config --global credential.https://github.com.useHttpPath true
# Then in each repo:
cd ~/work/project
git config credential.username work-username
cd ~/personal/project
git config credential.username personal-username
Method 3: Per-Repository Git Config
Setting Author Information Per Repo
Regardless of which authentication method you use, you need each repository to use the correct author name and email. Set this per-repo:
cd ~/work/project
git config user.name "Work Name"
git config user.email "work@company.com"
cd ~/personal/project
git config user.name "Personal Name"
git config user.email "personal@email.com"
Automating with Conditional Includes
Instead of configuring each repo individually, use Git’s conditional includes to apply settings based on directory:
# ~/.gitconfig (global)
[user]
name = Personal Name
email = personal@email.com
[includeIf "gitdir:~/work/"]
path = ~/.gitconfig-work
[includeIf "gitdir:~/freelance/"]
path = ~/.gitconfig-freelance
# ~/.gitconfig-work
[user]
name = Work Name
email = work@company.com
# ~/.gitconfig-freelance
[user]
name = Freelance Name
email = freelance@email.com
Now any repository cloned under ~/work/ automatically uses your work identity, and repos under ~/freelance/ use your freelance identity. No per-repo configuration needed.
Method 4: GitHub CLI (gh) Multi-Account
Using gh auth with Multiple Accounts
The GitHub CLI supports authenticating with multiple accounts:
# Login to personal account
gh auth login --hostname github.com
# Switch accounts
gh auth switch --user personal-username
gh auth switch --user work-username
# Check current status
gh auth status
Limitations
The gh CLI shares one active session globally. You can switch between accounts, but you can’t have two accounts active simultaneously in different terminals without additional configuration.
Method 5: Browser Profile Separation for GitHub Web UI
Why Browser Profiles Matter
Most developers spend significant time on GitHub’s web UI — reviewing pull requests, managing issues, configuring repository settings. Chrome’s native multi-account isn’t available for GitHub (GitHub sessions use cookies, not Google accounts), so you need browser-level separation.
Chrome Profiles
- Create a Chrome profile for each GitHub identity
- Log into the corresponding GitHub account in each profile
- Bookmark the organizations/repos you work with in each profile
- Use different profile colors/names for visual distinction
Advanced: Cloud Browser Isolation
For cases where GitHub accounts must appear completely independent (separate hardware fingerprints, IP addresses), remote browser isolation provides full separation. This is relevant for:
- Open-source contributors maintaining pseudonymous identities
- Security researchers who need operational separation
- Agencies managing client GitHub organizations
Cloud browser platforms like Send.win let you maintain completely isolated GitHub sessions without installing anything locally — each session has a unique browser fingerprint and IP address.
Common Problems and Solutions
Problem: Pushing to Wrong Account
You clone a personal repo but your global Git config uses your work email. All commits show your work identity.
Fix: Use conditional includes (Method 3) and organize repos into separate directories. Add a pre-commit hook that verifies the commit email:
#!/bin/bash
# .git/hooks/pre-commit
EMAIL=$(git config user.email)
if [[ "$EMAIL" != "expected@email.com" ]]; then
echo "ERROR: Git email is $EMAIL, expected expected@email.com"
echo "Run: git config user.email expected@email.com"
exit 1
fi
Problem: SSH Key Conflicts
SSH agent offers the wrong key to GitHub, causing authentication failures.
Fix: Use IdentitiesOnly yes in your SSH config (shown in Method 1). This prevents the SSH agent from trying keys other than the one specified for each host alias.
Problem: GPG Signing with Wrong Key
If you sign commits with GPG, each account may need its own GPG key.
Fix: Add GPG key configuration to your conditional includes:
# ~/.gitconfig-work
[user]
name = Work Name
email = work@company.com
signingkey = WORK_GPG_KEY_ID
[commit]
gpgsign = true
Recommended Workflow by Role
| Role | Recommended Setup | Complexity |
|---|---|---|
| Employee + Personal OSS | SSH keys + Conditional includes | Medium |
| Freelancer (2-3 clients) | SSH keys + Per-directory configs | Medium |
| Agency (many clients) | SSH keys + Browser isolation | Medium-High |
| Security researcher | Full browser isolation + VPN per identity | High |
| CI/CD automation | Deploy keys or GitHub Apps | Low-Medium |
Tools That Help
| Tool | Purpose | Free |
|---|---|---|
| SSH Config + Keys | Core multi-account authentication | Yes |
| Git Credential Manager | HTTPS credential management | Yes |
| direnv | Auto-set environment variables per directory | Yes |
| GitHub CLI (gh) | Command-line account switching | Yes |
| Send.win | Isolated browser sessions for web UI | Free tier |
| Firefox Multi-Account Containers | Container tabs for GitHub web UI | Yes |
How Send.win Helps You Master Github Manage Multiple Accounts
Send.win makes Github Manage Multiple Accounts 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.
FAQ — GitHub Multiple Accounts
Does GitHub allow multiple accounts?
Yes, GitHub’s Terms of Service allow individual users to have multiple accounts, though they recommend using a single account with organization memberships for most use cases. You must not use multiple accounts to circumvent rate limits or bans.
Can I contribute to the same repo from two accounts?
Yes, as long as both accounts have the appropriate access permissions. Each commit will be attributed to whichever account’s Git identity (name + email) is configured in that repo.
Will GitHub link my multiple accounts?
GitHub doesn’t publicly state how they detect account relationships. Using the same IP address, browser fingerprint, or SSH key across accounts could potentially link them. For complete separation, use the session isolation approach with different SSH keys and browser environments per account.
How do I handle GitHub notifications for multiple accounts?
GitHub notifications are per-account. You can configure email notifications to go to different email addresses and use filters in your email client to sort them. Alternatively, use the GitHub mobile app (which supports one account) supplemented by email notifications for other accounts.
Should I use SSH or HTTPS for multi-account setups?
SSH is generally preferred for multi-account setups because the SSH config file provides clean host-level routing. HTTPS with Git Credential Manager also works but requires more per-repo configuration. If your organization requires HTTPS (common in enterprise environments), GCM is the way to go.
🏆 Verdict: Best Way to Manage Multiple GitHub Accounts
The SSH keys + conditional Git includes combo is the gold standard for managing multiple GitHub accounts. It’s free, reliable, and handles both authentication and author identity automatically based on your directory structure. For web UI separation, pair it with Chrome profiles or cloud browser isolation depending on how much separation you need. Set it up once and never think about it again.
