Last active
January 6, 2020 15:41
-
-
Save moisei/c0ae02744a5549b769435819328ea1d6 to your computer and use it in GitHub Desktop.
how to use separate private keys for github bitbucket and other users
This file contains hidden or 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
https://superuser.com/questions/232373/how-to-tell-git-which-private-key-to-use | |
~/.ssh/config | |
host bitbucket.org | |
HostName bitbucket.org | |
IdentityFile ~/.ssh/github_rsa | |
User git | |
https://medium.com/@xiaolishen/use-multiple-ssh-keys-for-different-github-accounts-on-the-same-computer-7d7103ca8693 | |
github.com-work | |
^^^^^^ add -work suffix to the url according to user name work | |
[email protected]:[my work GitHub group]/[my project].git | |
# Personal GitHub account | |
Host github.com | |
HostName github.com | |
User git | |
AddKeysToAgent yes | |
UseKeychain yes | |
IdentityFile ~/.ssh/id_rsa | |
# Work GitHub account | |
Host github.com-work | |
HostName github.com | |
User git | |
AddKeysToAgent yes | |
UseKeychain yes | |
IdentityFile ~/.ssh/work_rsa |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment