⭐ If this helped you, give it a star!
💡 A complete beginner-to-pro guide to manage multiple GitHub accounts using SSH without conflicts.
🚀 Struggling with multiple GitHub accounts on the same system?
This guide solves authentication conflicts, wrong commits, and SSH issues step-by-step.
- Supports multiple GitHub accounts on one system
- Works on Windows (PowerShell)
- No authentication conflicts
- Clean and scalable setup
When using multiple GitHub accounts on the same system, you may face:
- Authentication conflicts
- Wrong account commits
- Push/pull permission issues
This setup solves these problems by:
- Using separate SSH keys
- Creating SSH aliases
- Assigning identity per repository
| Type | Username | |
|---|---|---|
| Personal | yashbelgahe99@gmail.com | ycode99 |
| Work | yashwant@gmail.com | yashwant |
Each GitHub account is mapped to a unique SSH key and alias:
github-personal→ Personal accountgithub-work→ Work account
This ensures Git uses the correct account automatically.
ssh-keygen -t ed25519 -C "yashwant@gmail.com"Save as:
C:\Users\yashq\.ssh\id_ed25519_workssh-keygen -t ed25519 -C "yashbelgahe99@gmail.com"Save as:
C:\Users\yashq\.ssh\id_ed25519_personal
C:\Users\yashq\.ssh\
├── config
├── id_ed25519_work
├── id_ed25519_work.pub
├── id_ed25519_personal
├── id_ed25519_personal.pub
Note: The SSH config file is typically located at:
C:\Users\yashq\.ssh\config# Work Account
Host github-work
HostName github.com
User git
IdentityFile C:\Users\yashq\.ssh\id_ed25519_work
# Personal Account
Host github-personal
HostName github.com
User git
IdentityFile C:\Users\yashq\.ssh\id_ed25519_personal
Open the terminal and run:
type C:\Users\yashq\.ssh\id_ed25519_work.pubEnter:
- Go to GitHub on browser → Settings
- Navigate to SSH and GPG Keys
- Click New SSH Key
- Paste the copied key
- Save the key
type C:\Users\yashq\.ssh\id_ed25519_personal.pubEnter:
- Go to GitHub on browser → Settings
- Navigate to SSH and GPG Keys
- Click New SSH Key
- Paste the copied key
- Save the key

Note: After adding the SSH keys to both accounts, run the following commands to verify the connection.
Go to Work account: Type:
ssh -T git@github-workOutput:
Hi <username>! You've successfully authenticated.Go to Personal account: Type:
ssh -T git@github-personalOutput
Hi <username>! You've successfully authenticated.git clone git@<alias>:<username>/<repo>.gitgit clone git@github-personal:ycode99/<repo-name>.git
git clone git@github-work:yashwant/<repo-name>.git
Note: Git identity is required only when creating commits. It determines which account the commit will be attributed to.
Rule:
If no commit is created, Git identity is not required.
If you are committing changes, Git identity must be configured.
git config user.name "Yashwant"
git config user.email "yashwant@gmail.com"git config user.name "ycode99"
git config user.email "yashbelgahe99@gmail.com"❌ Do NOT use:
git@github.com:...✅ Always use:
github-work
github-personalgit remote -v
git config user.email
ssh -T git@github-personal- Using default GitHub URL instead of SSH alias
- Not setting Git identity before commit
- Adding SSH key to the wrong account
GitHub Desktop:
- Uses the logged-in account
- Does not fully support SSH alias switching
👉 Recommended: Use VS Code + Terminal
C:\Users\yashq\work\
C:\Users\yashq\personal\This setup provides:
- Secure SSH authentication
- Correct commit attribution
- Smooth multi-account workflow
- Production-ready Git environment
Yashwant Belgahe
Full Stack Developer | MERN | Data Science & AI | Embedded Systems
Multiple github accounts ssh windows, github ssh config multiple accounts, use two github accounts same pc, git ssh multiple users, github work personal setup
If this helped you, please ⭐ star this repository — it helps others find it!






