SSH config entries use IdentitiesOnly yes to prevent GitHub from trying all available keys:
Host github.com-work
HostName github.com
User git
IdentityFile ~/.ssh/id_work
IdentitiesOnly yes
This ensures SSH only uses the specified key, avoiding authentication errors when multiple keys are loaded.
Convention: ~/.ssh/id_{profile_name}
ssh-keygen -t ed25519 -f ~/.ssh/id_work -C "work@company.com"
ssh-keygen -t ed25519 -f ~/.ssh/id_personal -C "personal@example.com"- macOS: Keys added to Keychain with
ssh-add --apple-use-keychain - Linux: Standard SSH agent
- Windows: Windows SSH agent
gpg --full-generate-key
gpg --list-secret-keys --keyid-format LONG
gh-switch add work email@example.com "Name" YOUR_KEY_IDTool sets user.signingkey and commit.gpgsign per profile.
git log --show-signature- Location:
~/.github-switcher/config.json - Permissions:
0600(user read/write only) - Contents: Profile metadata, directory rules (no secrets)
- Use Ed25519 SSH keys (stronger, smaller)
- Protect private keys with passphrases
- Rotate keys periodically
- Use separate keys per profile
- Enable GPG signing for verified commits
- Export profiles for secure backup