Skip to content

Instantly share code, notes, and snippets.

@ronbee
Created May 15, 2014 14:39
Show Gist options
  • Save ronbee/e0a88029640eb990c74a to your computer and use it in GitHub Desktop.
Save ronbee/e0a88029640eb990c74a to your computer and use it in GitHub Desktop.
git multiple keys configuration

edit ssh config

$ cd ~/.ssh/
$ touch config
$ vim config

and add the multiple keys to config:

# aaa account
Host github.com-aaa
HostName github.com
User git
IdentityFile ~/.ssh/id_rsa_aaa

# bbb account 
Host github.com-bbb
HostName github.com
User git
IdentityFile ~/.ssh/id_rsa_bbb

you are ready to go

git clone [email protected]:aaa/my_project.git my_project_aaa

As opsed to

git clone [email protected]:aaa/my_project.git my_project_default_git_user
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment