Last active
October 9, 2020 22:45
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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