Open source · MIT license · v1.0.0
Never push to the
wrong GitHub account
again
A lightweight tool that intercepts every git push, commit, and pull — and asks which account to use. Works from any folder, any editor, any terminal.
PS ~/projects/my-app ❯ git push origin main
+-------------------------------+
| Which Git account? |
+-------------------------------+
[1] personal (your-username)
[2] work (work-username)
-> Enter number (default 1): 2
[OK] Remote converted to SSH automatically
[OK] Using -> work (Jane Doe <jane@company.com>)
Writing objects: 100% (3/3), 248 bytes | 248 KiB/s, done.
To git@github-work:work-username/my-app.git
abc1234..def5678 main -> main
+-------------------------------+
| Which Git account? |
+-------------------------------+
[1] personal (your-username)
[2] work (work-username)
-> Enter number (default 1): 2
[OK] Remote converted to SSH automatically
[OK] Using -> work (Jane Doe <jane@company.com>)
Writing objects: 100% (3/3), 248 bytes | 248 KiB/s, done.
To git@github-work:work-username/my-app.git
abc1234..def5678 main -> main
1
script to run
∞
accounts supported
0
per-repo setup
Works in every environment
The problem
Managing two GitHub accounts
is a constant headache
Every existing solution requires per-repo config, manual steps, or breaks the moment you clone in the wrong folder.
Before
- Commits land on the wrong account
- Permission denied — wrong SSH key
- Forget to set user.email per repo
- includeIf breaks outside the right folder
- 15-step tutorials that still fail
After
- Picker appears on every push — you choose
- Right SSH key injected automatically
- Identity set per-command, every time
- Works from any folder, any editor
- One script to set up, done forever
How it works
One script. One restart.
Done forever.
The setup script handles everything. After that, just use git normally.
1
Run the setup script once
Enter your account details interactively. The script generates modern Ed25519 SSH keys, configures your SSH config with host aliases, and installs the git wrapper automatically.
2
Add your SSH keys to GitHub
The script prints your public keys and shows step-by-step instructions right in the terminal — exactly where to click, what to paste. Then it waits for you to confirm before continuing.
3
Restart your terminal
The switcher loads automatically in every terminal — PowerShell, VS Code, Windows Terminal, any editor. No manual setup per editor.
4
Pick your account on every push
From now on, every git push, commit, pull, fetch, merge, and rebase shows the picker. You choose. It handles the SSH key, identity, and HTTPS-to-SSH conversion automatically.
Features
Everything you need.
Nothing you don't.
Built to be simple, secure, and work everywhere out of the box.
Works from any folder
No per-repo configuration needed. The switcher is global — installed once, works in every project on your machine.
HTTPS auto-conversion
Paste the normal GitHub URL. The switcher detects HTTPS remotes and converts them to SSH automatically based on the account you pick.
Modern Ed25519 keys
No more deprecated SHA-1/RSA errors. The setup script generates Ed25519 SSH keys — the current OpenSSH standard.
Every editor, every terminal
VS Code, Windows Terminal, standalone PowerShell, macOS Terminal, Bash, Zsh — injected into the right shell profile automatically.
Unlimited accounts
Add as many profiles as you need. The picker lists all of them. Re-run the setup script anytime to add, edit, or delete.
Your gitconfig stays clean
Identity is injected per-command with -c flags. Your global ~/.gitconfig is never modified. Existing remotes keep working as-is.
Smart re-run
Re-run the setup script anytime. It detects existing profiles and shows a management menu — add, edit, delete — instead of starting over.
Zero secrets stored
No tokens, no passwords, no passphrases stored anywhere. Only SSH key file paths live in ~/.gitprofiles. Authentication is handled entirely by OpenSSH.
Beginner friendly
Step-by-step GitHub instructions printed right in the terminal. The script pauses and waits for you to add each key before continuing.
Install
Get started in 2 minutes
Clone the repo and run the setup script for your platform. That's all.
# Clone the repo
git clone https://github.com/Priyansh10ff/git-profile-switcher.git
cd git-profile-switcher
# Run the setup script (no signing required)
PowerShell -ExecutionPolicy Bypass -File scripts\setup-git-profiles.ps1
git clone https://github.com/Priyansh10ff/git-profile-switcher.git
cd git-profile-switcher
# Run the setup script (no signing required)
PowerShell -ExecutionPolicy Bypass -File scripts\setup-git-profiles.ps1
# Clone the repo
git clone https://github.com/Priyansh10ff/git-profile-switcher.git
cd git-profile-switcher
# Run the setup script
chmod +x scripts/setup-git-profiles.sh && ./scripts/setup-git-profiles.sh
git clone https://github.com/Priyansh10ff/git-profile-switcher.git
cd git-profile-switcher
# Run the setup script
chmod +x scripts/setup-git-profiles.sh && ./scripts/setup-git-profiles.sh
What developers say
Loved by developers who
juggle multiple accounts
"Finally. I've pushed work commits to my personal profile so many times it's embarrassing. This fixes it permanently."
"The HTTPS auto-conversion is the feature nobody else has. I can just paste the normal GitHub URL and it just works."
"Set it up in 5 minutes. Works in VS Code and standalone PowerShell without any extra config. Exactly what I needed."
"The step-by-step SSH key instructions in the terminal are a nice touch. My junior devs could set this up without my help."
"includeIf in .gitconfig was a nightmare to maintain. This is so much cleaner — one tool, works everywhere, no more manual switching."
"I've been looking for something like this for years. The Ed25519 key generation is a nice bonus — finally moved off RSA."
FAQ
Common questions
Does this affect my existing repos or remote URLs? +
No. Identity is injected per-command using -c flags and GIT_SSH_COMMAND. Your global ~/.gitconfig is never modified. If your remote is HTTPS, it gets automatically converted to SSH the first time you push — the URL is updated in place so future pushes work too.
Can I add more than 2 accounts? +
Yes — add as many as you want. Just re-run the setup script and choose "Add a new profile". The picker lists all of them automatically. There's no limit.
Why Ed25519 instead of RSA? +
RSA with SHA-1 is deprecated and rejected by newer versions of OpenSSH. You may have seen errors like "sign_and_send_pubkey: no mutual signature supported". Ed25519 is the modern standard — faster, shorter keys, and no deprecated algorithm errors.
Does it work in VS Code and other editors? +
Yes. The setup script injects the switcher into your CurrentUserAllHosts PowerShell profile on Windows, which loads automatically in every terminal — VS Code, Windows Terminal, standalone PowerShell, any editor that uses a shell terminal.
Is my data safe? Does it store passwords or tokens? +
No passwords, tokens, or passphrases are stored anywhere. The ~/.gitprofiles file contains only labels, names, emails, GitHub usernames, and SSH key file paths. Authentication is handled entirely by the system's OpenSSH client.
What git commands trigger the picker? +
The picker appears for: commit, push, pull, fetch, tag, merge, cherry-pick, and rebase. All other git commands (like status, log, diff, clone) pass through to git directly without showing the picker.
Open source · Free forever
Start using it today
One script. One restart. Never push to the wrong account again.