Skip to content

Instantly share code, notes, and snippets.

@flo-genymobile
Last active August 29, 2015 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save flo-genymobile/a48c116ca5a48cf7fc05 to your computer and use it in GitHub Desktop.
Save flo-genymobile/a48c116ca5a48cf7fc05 to your computer and use it in GitHub Desktop.
How to deal wiht multiple Git accounts on the same machine
### deal with multiple Git accounts on one machine
1. generate ssh key for each account
$ ssh-keygen -t rsa -C "your_email@example.com"
2. add the keys to github
3. edit the ~/.ssh/config file
Host userNameA
Hostname github.com
User git
IdentityFile path-to-ssh-key-for-userNameA
Host userNameB
Hostname github.com
User git
IdentityFile path-to-ssh-key-for-userNameB
(might need to chmod 600 the config file)
4. do git clone
$ git clone userName:organisationName/repo.git
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment