Created
January 24, 2019 19:55
-
-
Save litvil/6a52735784843be7e072c9b7b287221b to your computer and use it in GitHub Desktop.
Two Git accounts ssh config
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
In ~/.ssh/ create a file called config with contents based on this: | |
#user1 account | |
Host bitbucket.org-user1 | |
HostName bitbucket.org | |
User git | |
IdentityFile ~/.ssh/user1 | |
IdentitiesOnly yes | |
#user2 account | |
Host bitbucket.org-user2 | |
HostName bitbucket.org | |
User git | |
IdentityFile ~/.ssh/user2 | |
IdentitiesOnly yes | |
Replace user1 or user2 with your Bitbucket usernames | |
Generate key with: | |
ssh-add -K ~/.ssh/user1.rsa | |
Set remote with: | |
git remote set-url origin [email protected]:user1/your-repo-name.git |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment