Skip to content

Instantly share code, notes, and snippets.

@oafridi
Created April 21, 2014 18:54
Show Gist options
  • Save oafridi/11152606 to your computer and use it in GitHub Desktop.
Save oafridi/11152606 to your computer and use it in GitHub Desktop.
Multiple git ssh keys for two bitbucket accounts
workid and personalid:
1. Edit the ~/.ssh/config file
Add an alias for each identity combination for example:
Host workid
HostName bitbucket.org
IdentityFile ~/.ssh/workdid
Host personalid
HostName bitbucket.org
IdentityFile ~/.ssh/personalid
2. substitute in the alias i.e git@bitbucket.org:accountname/reponame.git - git@alias:accountname/reponame.git
3. add key to bitbucket via web UI
4. Make sure ssh-agent is running and loaded keys:
ssh-add -l
ssh-add ~/.ssh/workid
@rdkhosla
Copy link

Thanks for putting this up. It was super helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment