GitHub is awesome, and I use it for both work projects and personal projects. I have a separate GitHub account for each profile.
What if I want to be able to work with repositories from both GitHub accounts on one machine?
Well, since I connect to GitHub via SSH, all I need to do is configure my SSH setup with multiple SSH keypairs.
GitHub has great documentation on how to do this:
- Guides: Multiple GitHub Accounts
http://github.com/guides/multiple-github-accounts - Generating SSH keys (Win/msysgit)
http://help.github.com/msysgit-key-setup/ - Multiple SSH keys
http://help.github.com/multiple-keys/
Also, because I’m working with multiple repositories using different personas, I need to make sure that my individual repositories have the user settings overriden accordingly:
Setting user name, email and GitHub token – Overriding settings for individual repos
http://help.github.com/git-email-settings/
João Paulo Lethier
December 5, 2011
I need to work from my notebook with two different accounts from Github, but these links in your post aren’t explanations about how to do this anymore. Can you help me how can I configure my ssh keys to work with different accounts? I have already created two pairs of keys.
Spyder
December 17, 2011
Looks like the github page was deleted – rather than typing it out myself, someone’s posted the answer to Stack Overflow
http://stackoverflow.com/a/8483960/7546