Git identity for multi-account developers

Every repo gets the right GitHub identity.

gitswitch keeps your commit author, GitHub CLI account, SSH key, and signing identity aligned with the repo you’re in. Run work, personal, and AI-agent sessions side by side—without flipping one shared account back and forth.

view all options →
$brew install aksisonline/tap/gitswitch

v0.4.4 · Open source · Written in Go
macOS, Linux, Windows

New to Git? Get set up from scratch →

gitswitch: identity manager
✦ Gitswitch
identity manager for git
Accounts·Utilities·Settings
Current aksisonline · user@gmail.com
· default user@default.com
❯ ✓ aksisonline user@gmail.com
· work user@company.com
↑↓ navigate · enter switch · p pin · a add
e edit · ? cli tips · 1-3 tabs / click · q quit
hover or tab to interact · try 1-3 ↑↓ ↵

Git and GitHub don’t share one identity setting.

gh auth switch changes the account used by GitHub CLI. Git keeps your commit name and email separately, while SSH and commit signing use their own keys.

When you work across accounts, switching one setting can leave another behind. gitswitch brings them together in a profile and applies the right identity for each repo.

Side by side. Still yours.

Pin each repo once. With session isolation enabled, each terminal’s GitHub commands use that repo’s account. Here’s an example with work and personal profiles already set up.

work · ~/work/api
$ gitswitch pin work
$ git config user.email
you@company.com

$ gh api user --jq .login
work-account
personal · ~/personal/site
$ gitswitch pin personal
$ git config user.email
you@personal.dev

$ gh api user --jq .login
personal-account

A router, not a credential vault. Your keys stay in ~/.ssh/, your tokens stay in your OS keychain. gitswitch decides which identity applies to the repo you’re in. Read how it works →

Your identity follows the repo.

[01]
Your identity follows the repo.
Pin a profile once with gitswitch pin work. Your name and email stay with that repo, even if your global Git identity is different.
[02]
Use multiple GitHub accounts at once.
Each terminal resolves gh commands for the repo you’re working in. Keep work and personal sessions open at the same time—without one terminal changing the account another uses.
[03]
Match the right SSH and signing keys.
Attach SSH and GPG or SSH signing keys to a profile. gitswitch selects the matching SSH key and signing identity when you switch profiles.
[04]
Fix a commit made under the wrong identity.
Use gitswitch reauthor to rewrite the author and committer on commits that already exist. Review shared history before rewriting it.
[05]
Works in your terminal—and agent-launched shells.
Use the same repo-aware behavior in your regular shell, editor terminal, or a coding agent working inside a repo. gitswitch claude can install the Claude Code skill.

Log in. Pin a repo. Keep working.

  1. Log in once. gitswitch login hands off togh auth login and creates your profile—no token to copy into another tool.
  2. Add your identities. Set the name and email for each profile; attach SSH or signing keys if you use them.
  3. Pin a repo. Run gitswitch pin work in a repo. Then keep using git and gh as usual.

Start with one repo.

[if]
Using includeIf?
Keep your existing setup or start pinning repos individually. gitswitch can manage Git identity, GitHub account, and keys together instead of requiring hand-maintained directory rules.
[ssh]
Using SSH host aliases?
gitswitch can select a profile’s SSH key with core.sshCommand and IdentitiesOnly=yes, alongside the rest of that profile.
[cli]
Already using another switcher?
Start with one repo. Add other profiles and session isolation when you need them.

Get gitswitch.

The Go CLI from gitswitch.dev for parallel GitHub identity isolation. Pick the install method for your platform.

homebrewmacOS · Linux · recommended
$brew install aksisonline/tap/gitswitch
curlmacOS · Linux · WSL
$curl -fsSL https://get.gitswitch.dev | bash
go installany platform · requires go 1.22+
$go install github.com/aksisonline/gitswitch@latest
windowsPowerShell
$irm https://get.gitswitch.dev/install.ps1 | iex

Questions, answered.

$ Do I need multiple GitHub accounts?
No. gitswitch can also set up Git and GitHub CLI for your first commit.
$ Does gitswitch replace GitHub CLI?
No. gitswitch adds repo-aware identity and session management around your existing Git and GitHub CLI workflow.
$ Do I need to create SSH keys by hand?
No. Add a key to a profile if you want to use one; you can also start without configuring one.
$ Can it fix a commit I already made?
Yes. gitswitch reauthor rewrites the author and committer on existing commits. If the commits are already shared, coordinate before rewriting history.
$ Is gitswitch open source?
Yes. It’s written in Go and licensed under Apache-2.0.