7 ms·
Nice article! The only thing I'd add is that you can extend this to multiple GitHub identities, too, via SSH configs: https://www.bendb.com/blog/ssh-with-multi
by pianoben 7y ago
Nice article! The only thing I'd add is that you can extend this to multiple GitHub identities, too, via SSH configs: https://www.bendb.com/blog/ssh-with-multiple-github-accounts/ https://www.bendb.com/blog/ssh-with-multiple-github-accounts...
I've been using variations on this technique for a few years now. It's kind of a pain to remember which URL to use to clone a repo, but is great for keeping that veneer of separation between work and personal projects.
- unityByFreedom 7y agoYeah I also sometimes forget to use the proper URL, I wish it were a little easier to setup and use the concept of separating work/personal or public/private repositories.
- neilpa 7y agoYou can extend this trick further by specifying the User in your SSH config to make for even shorter URLs. Host gh-me Hostname github.com User git IdentityFile ~/.ssh/id_rsa Host gh-work Hostname github.com User git IdentityFile ~/.ssh/id_rsa_work Then all you need is a `git clone gh-me:org/repo` or `git clone gh-work:work/repo`. I've been using this for sometime and it's not too hard to remember. Although when I don't it's easy enough to fix the origin url by editing `.git/config`.
- epistasis 7y agoI've been using the same account for both work and personal repos, without much issue due to the existence of github organizations. What sorts of separation are beneficial for you? I'm wondering if I should switch, but I don't fully understand.
- pianoben 7y agoDepending on the employer and the side-project, using the same account for both could _in theory_ bolster a (ridiculous, absurd) ownership claim over your work, for example. Stranger things have happened. More pragmatically, I've been burned in the past by using personal accounts (not GitHub specifically) for work things. For example, I used a personal commuter card for a former job's benefits program. When I left, they deactivated my card. Awkward! Not the same kind of risk with GH, to be sure, but after that I do prefer to keep my digital selves as compartmentalized as possible.