Someone recently commented that with Github it is "a pain if you want to have a work and personal identity."
It is? I've had separate work and personal Github accounts for years. I thought everyone knew this trick.
When I clone a URL like [email protected]:TomOnTime/tomutils.git
I simply change github
to either github-home
or github-work
.
Then I have my ~/.ssh/config
file set with those two names
configured to use different keys:
# TomOnTime
Host home-github.com
HostName github.com
User git
IdentityFile ~/.ssh/id_rsa-githubpersonal
PreferredAuthentications publickey
PasswordAuthentication no
IdentitiesOnly yes
# tlimoncelli
Host work-github.com
HostName github.com
User git
IdentityFile ~/.ssh/id_rsa-githubwork
PreferredAuthentications publickey
PasswordAuthentication no
IdentitiesOnly yes
I also have things set up so that if I leave the name alone, my work-owned machines default to the work key, and my personal machines default to my personal key.
As far as the web user interface, rather than switching between accounts by logging out and logging back in all the time, I simply use Chrome's multi-user feature. Each user profile has its own cookie jar, maintains its own set of bookmarks, color themes, and so on. One user is my "work" profile. It is green (work==money==green), has bookmarks that are work-related, and is logged into my work Github account. The other is my "home" profile. It is blue (I live in a blue house), has my personal bookmarks, and is logged into my personal Github account.
Having each profile be a very different color makes it very easy to tell which profile I am in. This prevents me from accidentally using my work profile for personal use or vice-versa.
I know some people do something similar by using different browsers but I like this a lot more.
Once I set this up using multiple accounts on Github was easy!
Leave a comment