gacc is the project name for this Git Account & SSH Key Manager.
gacc is a CLI for managing multiple GitHub accounts and SSH keys on one machine.
It helps developers switch between personal and work Git identities safely, configure SSH access per account, and avoid pushing or committing with the wrong credentials.
gacc is a Git account manager for developers who use more than one GitHub account on the same computer.
It automates SSH key generation, GitHub authentication, SSH config updates, and per-repository Git identity switching.
gacc is useful for developers who need to:
- Manage multiple GitHub accounts on one machine
- Use separate SSH keys for work and personal repositories
- Switch Git identities per repository without changing global Git settings
- Reduce GitHub authentication mistakes and SSH host conflicts
Managing multiple GitHub accounts usually means editing ~/.ssh/config, creating and naming SSH keys manually, and remembering which repositories should use which identity.
gacc turns that into a repeatable workflow so you can:
- Manage multiple GitHub accounts without overwriting SSH settings
- Switch Git identities safely between repositories
- Route Git remotes through account-specific SSH aliases
- Keep local repository settings isolated from your global Git config
- Generate and register SSH keys for each Git account
- Authenticate with GitHub using the device flow
- Update
~/.ssh/configwith account-specific GitHub host aliases - Activate a selected Git identity for the current Git repository
- Activate a selected Git identity globally for all Git operations
- Automatically apply accounts by directory using Git
includeIf - Deactivate repository-specific overrides and return to global defaults
- Show local, auto, and global account status for the current directory
- Display, rename, cache, backup, and restore managed account keys
- Delete local account records and remove uploaded SSH keys from GitHub
brew tap soongeo/gacc https://github.com/soongeo/gacc
brew install gaccgo install github.com/soongeo/gacc@latestPrebuilt binaries for macOS, Linux, and Windows are available on the Releases page.
gacc add work
cd your-repository
gacc activate workThis flow creates an SSH key for the work account, uploads it to GitHub, and applies that identity to the current repository.
For a directory-based workflow, you can configure automatic switching:
gacc add work
gacc add personal
gacc auto add work ~/Work
gacc auto add personal ~/PersonalFor a machine-wide default identity, you can configure a global account:
gacc global activate workAdds a new Git account, generates an SSH key, starts GitHub device authentication, uploads the public key, and stores profile data locally.
gacc add workLists the Git accounts registered on your machine and highlights the account currently active for the repository when possible.
gacc listApplies a selected account to the current Git repository by updating the origin remote and local user.name and user.email values.
cd client-project
gacc activate workIf you omit [name], gacc will try to use the currently active account or prompt you to choose one.
Removes repository-specific overrides so the repository goes back to your default Git behavior.
cd client-project
gacc deactivateApplies a selected account globally by setting global user.name, user.email, and core.sshCommand.
gacc global activate workClears global gacc-managed Git identity and SSH command settings.
gacc global deactivateAutomatically applies an account for repositories under a directory using Git includeIf.
gacc auto add work ~/WorkLists configured automatic directory-based account rules.
gacc auto listRemoves an automatic directory-based account rule.
gacc auto remove work ~/WorkShows the local, automatic, and global account state for the current directory.
gacc statusDisplays the public SSH key for an account.
gacc display workRenames an account alias and updates associated key files and config references.
gacc rename work companyAdds an account SSH key to ssh-agent.
gacc cache workBacks up gacc config and managed SSH keys into a tar.gz archive.
gacc backupRestores gacc config and managed SSH keys from a backup archive.
gacc restore ./gacc-backup-20260330153000.tar.gzDeletes the local SSH key and config for an account and attempts to remove the registered public key from GitHub.
gacc delete workgacc now supports three ways to apply an identity:
local: Explicitly set an account for the current repository withgacc activateauto: Automatically apply an account by directory withgacc auto addglobal: Set a machine-wide default withgacc global activate
- Use
localwhen you want to choose the account per repository. - Use
autowhen everything under a folder such as~/Workshould always use the same account. - Use
globalwhen you want a default account everywhere unless a more specific rule overrides it.
gacc resolves settings from most specific to least specific:
- Local repository settings from
gacc activate - Directory-based automatic settings from
gacc auto add - Global defaults from
gacc global activate - Any other plain Git defaults outside
gacc
In practice, that means:
- Local
user.nameanduser.emailoverride auto and global values - Auto rules override global defaults for matching directories
- Global settings act as the fallback when no local or auto rule applies
Use gacc status to see which layer is active for the current directory.
gacc add work
gacc add personal
cd ~/src/client-a
gacc activate work
cd ~/src/oss-project
gacc activate personalgacc add work
gacc add personal
gacc auto add work ~/Work
gacc auto add personal ~/Personal
cd ~/Work/client-a
gacc statusgacc global activate personal
cd ~/Work/client-a
gacc activate work
gacc statusCreate one account profile for work and another for personal, then activate the right one inside each repository.
gacc creates account-specific SSH aliases so multiple GitHub accounts can coexist without editing SSH settings by hand every time.
gacc activate writes repository-level settings instead of changing your global Git identity for every project.
Use gacc auto add to map directories such as ~/Work and ~/Personal to different accounts.
Use gacc global activate when one identity should be the default unless a repository or directory rule overrides it.
Manual setup usually requires:
- Generating SSH keys manually
- Editing
~/.ssh/configby hand - Updating Git remotes for host aliases
- Remembering to change local
user.nameanduser.email
gacc combines those steps into a single CLI workflow designed for developers managing multiple GitHub accounts and SSH keys.
Use separate SSH keys and SSH host aliases for each account, then apply the correct Git identity per repository.
gacc automates this setup and switching workflow.
Create one gacc account per identity, such as work and personal.
Each account gets its own SSH key and GitHub SSH alias.
Change into the repository directory and run gacc activate [name].
This updates the repository to use the selected account.
Run gacc auto add work ~/Work.
Then repositories under that directory will automatically use the configured account settings.
gacc activate does not change your global Git configuration.
If you want a global default identity, use gacc global activate [name].
Yes. It updates the Git remote host alias and repository-level Git identity so the selected repository uses the intended account.
Check that your network allows GitHub device flow authentication and try running gacc add [name] again.
Run git status first and make sure you are inside a repository before using gacc activate or gacc deactivate.
Run gacc status to inspect the current local, automatic, and global account layers.
You can also run gacc list to see which registered accounts are marked as local, auto, or global.
Download binaries and release builds from the GitHub Releases page.
Questions, bug reports, and pull requests are welcome at the GitHub repository.