Manage multiple GitHub SSH profiles on a single machine. gitswitch wraps git — all unknown subcommands are forwarded transparently to git.
- Profile Management: Generate and manage multiple SSH keys (e.g.,
work,personal) effortlessly. - Auto-Setup: The installation script interactively guides you to set up your profiles right away.
- Interactive TUI: Beautiful, animated arrow-key menus for selecting and creating profiles.
- Auto-Alias: The installer automatically aliases
gittogitswitchin your shell (zsh/bash/PowerShell). You just typegit cloneas usual! - Auto-Routing: Automatically maps clone and remote URLs to the correct SSH identity.
- Git Passthrough: Fully compatible with all
gitcommands.gitswitchintercepts what it needs to and forwards everything else.
curl -fsSL https://raw.githubusercontent.com/ESRAILHAQUE/gitswitch/main/scripts/install.sh | bashTo install into ~/.local/bin (no sudo), override the location:
curl -fsSL https://raw.githubusercontent.com/ESRAILHAQUE/gitswitch/main/scripts/install.sh | bash -s -- --install-dir ~/.local/binPrerequisites: Git for Windows (choose "Git from the command line and also from 3rd-party software") and an OpenSSH client.
irm https://raw.githubusercontent.com/ESRAILHAQUE/gitswitch/main/scripts/install.ps1 | iexIf you have Go installed, you can easily install the latest version:
go install github.com/ESRAILHAQUE/gitswitch@latestAfter running the installation command, the script will automatically ask how many GitHub accounts you want to set up:

Provide your name, email, and a short alias (e.g., work) for the first profile:

Set up your second profile (e.g., personal) to keep things separate:

Finally, copy the generated SSH keys and add them to your GitHub settings (Settings -> SSH and GPG keys):

(Note: If you used the installer, git is automatically aliased to gitswitch. You can use git directly!)
# Clone a repository using a specific profile
git clone work:myorg/myrepo
# In an existing local repository, initialize and attach a profile
git init
# Add a remote (gitswitch automatically rewrites HTTPS URLs to use your SSH profile)
git remote add origin https://github.com/myorg/myrepo
# View all your configured profiles
git list(If you didn't set up the alias, use gitswitch instead of git for these commands)
git gen: Interactively creates a new SSH profile.git init: Initialises a git repo (if needed) and setsuser.name/user.emailfrom a profile.git clone: Clones a repository using a profile key or an HTTPS URL.git list: Lists all registered profiles.git fix: Rewrites an existing GitHub HTTPS remote to SSH using a chosen profile.git del: Removes a profile.
Any other unrecognised subcommand is forwarded to git.
Profiles are stored securely in ~/.config/gitswitch/profiles.json.
Keys and host mappings are saved into ~/.ssh/gitswitch_<key> and ~/.ssh/config.