Quick Start
Add profiles and switch identities in under five minutes
This page covers adding your first profiles and switching between them.
1. First run
gitswitchOn first launch with no existing profiles, gitswitch reads your current git config --global user.name and git config --global user.email and saves them as a profile named default. Then it opens the TUI.
2. Add profiles
Via CLI
# Git identity only
gitswitch add personal "Alice Smith" alice@gmail.com
# With SSH key
gitswitch add work "Alice Smith" alice@company.com \
--ssh-key ~/.ssh/id_work
# Full setup: SSH key + GPG signing + GitHub CLI
gitswitch add corp "Alice Smith" alice@corp.com \
--ssh-key ~/.ssh/id_corp \
--sign-key ABCD1234EF567890 \
--gh-user alice-corpVia TUI
Press a in the TUI to open the add-profile form. Navigate fields with Tab. Press Enter to save.
3. Switch profiles
Quick switch (no UI)
gitswitch workOutput:
✓ Switched to 'work' — Alice Smith <alice@company.com>Interactive TUI
gitswitch| Key | Action |
|---|---|
↑ / ↓ or k / j | Move cursor |
Enter | Switch to selected profile |
a | Add profile |
e | Edit profile |
ctrl+d (in edit form) | Delete profile |
c | Cycle color theme |
? | Show CLI quick reference |
q / ctrl+c | Quit |
4. Check current identity
gitswitch currentwork — Alice Smith <alice@company.com>5. Set up shell integration
gitswitch installThis runs an interactive wizard that installs:
- Prompt segment — shows active identity when inside a git repo
- Identity nudge — on
cdinto a repo, prompts you to switch if a different identity is usually used there - Tab completion — completes
gitswitchcommands and profile nicknames
After running, reload your shell:
source ~/.zshrc # zsh
source ~/.bashrc # bash
# or open a new terminal6. Pin a repo to an identity
If you always want a specific profile in a repo, pin it:
cd ~/work/my-project
gitswitch pin workPinned 'work' to this repoFrom now on, gitswitch recommend (used by the shell nudge hook) always returns work for that repo, regardless of usage history.
Remove the pin:
gitswitch unpinUnpinned — identity recommendation now based on usage historyList all profiles
gitswitch list✓ personal Alice Smith <alice@gmail.com>
work Alice Smith <alice@company.com>
corp Alice Smith <alice@corp.com>The ✓ marks the currently active profile.