Skip to content

Instantly share code, notes, and snippets.

@kezzyhko
Last active October 9, 2020 22:45
Show Gist options
  • Save kezzyhko/734b83a763c1feb6f38fdf096800718f to your computer and use it in GitHub Desktop.
Save kezzyhko/734b83a763c1feb6f38fdf096800718f to your computer and use it in GitHub Desktop.
An example of git ssh configuration for using different keys with the same host
# An example of git ssh configuration for using different keys with the same host
# You should put this file in ~/.ssh/config
# And change IdentityFile to the paths to your keys
# After that, you can use the keys like that:
# git clone ssh://github_key1/user/repo1.git
# git clone ssh://github_key2/user/repo2.git
Host github_key1
HostName github.com
User git
IdentityFile ~/my-ssh-keys/private-key1
IdentitiesOnly yes
Host github_key2
HostName github.com
User git
IdentityFile ~/my-ssh-keys/private-key2
IdentitiesOnly yes
# etc.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment