// docs
Get Started

Quick Start

From zero to "I never think about this again" in about two minutes

Two commands. That's the whole thing.

gitswitch            # 1. first run — sets up git/gh, connects your account
gitswitch pin work   # 2. claim a repo

Below is what actually happens, in case you like knowing.

1. First run

gitswitch

On a machine with no profiles yet, this checks for git/gh first, then picks one of two paths automatically:

  • Nothing set up yet — installs git/gh, then you log in with GitHub. Done.
  • Already have git config or a gh login — imports it, matching a gh account to your git config by verified email so you don't get duplicates.

You can also do the login step directly, any time, instead of through the wizard:

gitswitch login

Opens a GitHub login prompt (browser, device code, or token — whichever gh offers):

  ✓  Logged in as alice-corp (github.com)
  ✓  Profile "alice-corp" created

Your name, email, and GitHub username are filled in for you. Run it again for each account you have:

gitswitch login                      # personal
gitswitch login --profile work       # work, with a nicer nickname
gitswitch login --host github.acme.com   # GitHub Enterprise

No SSH keys to generate, nothing to paste into a settings page. If you'd rather bring your own keys, see SSH Keys — or type a profile in by hand:

gitswitch add work "Alice Smith" alice@company.com --gh-user alice-corp

See them all:

gitswitch list
✓  personal        Alice Smith <alice@gmail.com>
   work            Alice Smith <alice@company.com>

The ✓ is your current global identity.

2. Claim your repos

cd ~/work/api
gitswitch pin work
✓ Pinned 'work' to this repo — Alice Smith <alice@company.com> (local git config; global identity unchanged)

Every commit in that repo now uses work. Every push uses work's token. Every gh pr create acts as work. Your global identity — and every other repo — is left exactly as it was.

Do it once per repo and you are finished thinking about this:

cd ~/personal/blog     && gitswitch pin personal
cd ~/clients/acme/api  && gitswitch pin acme

Changed your mind? gitswitch unpin.

Already configured a repo by hand years ago? Run gitswitch pin with no name. gitswitch reads the repo's existing user.email, matches it to one of your accounts, and fills in the rest.

Shell integration (optional, but worth it)

gitswitch shell

A short wizard with three steps, each one explaining itself and each one skippable:

StepWhat you get
Shell integrationYour prompt shows which account is active, you get nudged if a repo looks wrong, and tab-completion works.
HTTPS credential routinggit push over HTTPS uses the right account's token instead of whatever your keychain hands over.
Session IsolationEach terminal's gh commands resolve the account for the repo you're in — and it's what makes repo pins work.

Then reload your shell:

source ~/.zshrc    # zsh
source ~/.bashrc   # bash
# or just open a new terminal

Everything gitswitch writes lives between # gitswitch markers in your rc file. Re-running shell replaces that block in place — it never appends a second copy.

Switching by hand

Pins cover the repos you own. For everything else:

gitswitch work        # switch global identity, right now
gitswitch current     # who am I in here?
work — Alice Smith <alice@company.com>  (pinned to this repo)

That parenthetical matters — it tells you why you're that person. See Scopes.

The interactive UI

gitswitch

Three tabs — Accounts, Utilities, Settings — switched with 1 2 3, tab, or a mouse click. Yes, the mouse works.

KeyDoes
↑ ↓ / k jMove
enterSwitch to this account (globally)
pPin this account to the current repo — press again to unpin
aAdd an account
eEdit — ctrl+d inside the form deletes
vShow GitHub usernames instead of emails
cNext color theme (there are 12)
uUpgrade — only appears when there's something to upgrade to
?CLI cheat sheet
qOut

First launch with no accounts runs a short onboarding wizard — it scans your gh logins and ~/.ssh/ keys and offers to import what it finds.

Where next

On this page