
Why You Need Multiple GitHub Accounts in VSCode
Developers frequently need to VSCode manage multiple GitHub accounts — whether it’s keeping personal projects separate from work, contributing to open source under a pseudonym, or managing client repositories as a freelancer. The challenge is that Git and GitHub weren’t designed for multi-account workflows out of the box.
By default, VSCode uses a single set of Git credentials. Pushing to a repository under a different GitHub account requires manual credential switching, which is error-prone and time-consuming. In this guide, we’ll show you the definitive setup for managing multiple GitHub accounts in VSCode — using SSH keys, conditional Git configs, and VSCode extensions.
The Problem: Default Git Credentials
When you first configure Git, you typically set a global username and email:
git config --global user.name "Your Name"
git config --global user.email "[email protected]"
This applies to every repository. If you push commits using this global config while working on a repository that belongs to a different GitHub account, those commits will be attributed to the wrong identity.
Common Symptoms
- Push rejected with “permission denied” errors because Git used the wrong account’s token
- Commits showing up under the wrong GitHub profile
- Confusing contribution graphs that mix personal and work activity
- Having to manually reset credentials every time you switch accounts
How Send.win Helps You Master Vscode Manage Multiple Github Accounts
Send.win makes Vscode Manage Multiple Github 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.
Solution 1: SSH Keys (Recommended)
The most reliable way to manage multiple GitHub accounts is to create a separate SSH key for each account and configure SSH to use the right key for the right repository.
Step 1: Generate SSH Keys
# For your personal account
ssh-keygen -t ed25519 -C "[email protected]" -f ~/.ssh/id_personal
# For your work account
ssh-keygen -t ed25519 -C "[email protected]" -f ~/.ssh/id_work
Step 2: Add Keys to SSH Agent
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_personal
ssh-add ~/.ssh/id_work
Step 3: Add Public Keys to GitHub
For each GitHub account, go to Settings → SSH and GPG keys → New SSH key and paste the corresponding public key.
Step 4: Configure SSH Config File
Edit ~/.ssh/config to define host aliases for each account:
# 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
Step 5: Clone Using Host Aliases
# Clone using personal account
git clone git@github-personal:personal-user/my-project.git
# Clone using work account
git clone git@github-work:company/work-project.git
Step 6: Update Existing Repositories
git remote set-url origin git@github-work:company/existing-project.git
Solution 2: Conditional Git Configs
SSH keys handle authentication, but you also need the right name and email on your commits. Conditional Git configs automate identity switching based on your project directory.
Directory Structure
~/projects/
├── personal/ # Personal GitHub repos
├── work/ # Work GitHub repos
└── freelance/ # Freelance GitHub repos
Global Git Config (~/.gitconfig)
[user]
name = Personal Name
email = [email protected]
[includeIf "gitdir:~/projects/work/"]
path = ~/.gitconfig-work
[includeIf "gitdir:~/projects/freelance/"]
path = ~/.gitconfig-freelance
Account-Specific Configs
Create ~/.gitconfig-work:
[user]
name = Work Name
email = [email protected]
Now, any repository inside ~/projects/work/ automatically uses your work identity.
Solution 3: VSCode-Specific Setup
With SSH keys and conditional configs in place, VSCode needs a few adjustments.
VSCode GitHub Authentication
VSCode’s built-in GitHub integration uses OAuth tokens and only supports one account at a time. The workaround:
- Use SSH for Git operations (push, pull, clone) — this is account-independent
- Keep OAuth signed in for features like Copilot and PR reviews
- The SSH config handles which account authenticates each repository automatically
Useful VSCode Extensions
| Extension | Purpose |
|---|---|
| GitHub Pull Requests | Manage PRs from multiple repos within VSCode |
| GitLens | Rich Git history, blame annotations, commit details |
| Git Graph | Visual branch and commit history |
| Project Manager | Quick-switch between projects organized by account |
Advanced: GPG Commit Signing Per Account
If you sign commits with GPG keys, you’ll need separate keys for each account. Add the signing key to each account-specific gitconfig:
[user]
signingkey = WORK_GPG_KEY_ID
[commit]
gpgsign = true
Managing Multiple Online Accounts Beyond GitHub
If you work across multiple platforms — GitHub, GitLab, Bitbucket — the SSH config approach works identically with more host aliases. For managing multiple online accounts in general — whether it’s cloud consoles, project management tools, or client dashboards — having isolated browser sessions for each client can complement your Git setup.
A tool like Send.win lets you maintain separate browser profiles for each client’s GitHub, AWS console, and project management tools — all with unique fingerprints and sessions, similar to how SSH keys isolate your Git authentication.
Troubleshooting Common Issues
Permission Denied (publickey)
ssh -T git@github-personal
# Should respond: "Hi personal-username! You've successfully authenticated"
Wrong Email on Commits
cd ~/projects/work/my-project
git config user.email
# Should show: [email protected]
SSH Agent Not Persisting
Add to your shell profile (~/.bashrc or ~/.zshrc):
eval "$(ssh-agent -s)" > /dev/null
ssh-add ~/.ssh/id_personal 2>/dev/null
ssh-add ~/.ssh/id_work 2>/dev/null
Frequently Asked Questions
Can I use VSCode with two GitHub accounts simultaneously?
Yes. Use SSH for Git operations and OAuth for features like Copilot. Your SSH config ensures each repository authenticates with the correct account automatically. You can have repos from different accounts open in the same multi-root workspace.
Will this setup work with GitHub Copilot?
GitHub Copilot uses your signed-in VSCode account, which is separate from your Git credentials. You can have Copilot running under your work account while pushing code to a personal repository using a different SSH key.
How do I switch the default GitHub account in VSCode?
Go to Accounts (bottom-left) → Sign out → Sign in with the different account. For Git operations, this switch is unnecessary if you’re using SSH keys.
Is there a VSCode extension for managing multiple GitHub accounts?
No single extension handles everything, but combining Project Manager (for workspace switching) with the SSH key approach gives you seamless multi-account management. GitLens also shows which identity is active per repository.
Complete Setup Checklist
- Generate separate SSH keys for each GitHub account
- Add public keys to respective GitHub accounts
- Configure
~/.ssh/configwith host aliases - Test SSH connections with
ssh -T - Set up conditional Git configs for automatic identity switching
- Organize projects into account-specific directories
- Update existing repository remotes to use host aliases
- Install helpful VSCode extensions (GitLens, Project Manager)
Conclusion
Managing multiple GitHub accounts in VSCode doesn’t have to be painful. With SSH keys providing automatic authentication and conditional Git configs handling identity switching, you can work across personal, work, and freelance accounts seamlessly. The key: use SSH host aliases for authentication and conditional configs for identity — and you’ll never accidentally push with the wrong account again.
