Managing multiple GitHub accounts on one machine usually requires separate SSH keys, custom SSH host aliases, and repository-specific Git identity settings.
gacc simplifies that process by generating keys, updating SSH config, connecting to GitHub, and switching the active account locally, automatically by directory, or globally for the whole machine.
Using both work and personal GitHub accounts on one computer often causes:
~/.ssh/configgacc add work
gacc add personal
This creates separate SSH keys and registers them with GitHub.
cd ~/projects/company-repo
gacc activate work
cd ~/projects/side-project
gacc activate personal
This updates the current repository so it uses the right SSH route and Git identity.
gacc auto add work ~/Work
gacc auto add personal ~/Personal
This uses Git includeIf so repositories under those folders automatically use the configured account.
gacc global activate personal
This sets a default identity for Git operations everywhere unless a more specific local or automatic rule overrides it.
gacc status
This shows the local, automatic, and global account layers for the current directory.
gacc deactivate
gacc global deactivate
Use gacc deactivate to clear repository-level overrides and gacc global deactivate to clear the machine-wide default.
gacc ChangesWhen you manually activate an account with gacc activate, gacc can:
user.nameuser.emailWhen you use gacc auto add, gacc creates Git includeIf rules that apply account settings by directory.
When you use gacc global activate, gacc sets global user.name, user.email, and core.sshCommand.
gacc applies the most specific layer first:
gacc activategacc auto addgacc global activateIn practice:
Run gacc status to inspect the active layers for the current directory.
gaccUse gacc if you want to:
Use a different SSH key and SSH alias for each account.
gacc automates the setup and GitHub registration for you.
Apply repository-specific Git settings instead of changing your global Git identity.
gacc activate [name] is built for this workflow.
~/Work?Run gacc auto add work ~/Work.
That directory and its repositories will automatically use the configured account settings.
Keep each repository pinned to the right account and only change its local configuration. That approach avoids accidental global changes.