Last active
August 29, 2015 14:05
-
-
Save flo-genymobile/a48c116ca5a48cf7fc05 to your computer and use it in GitHub Desktop.
How to deal wiht multiple Git accounts on the same machine
This file contains 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
### 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