by pianoben · 6y ago · 0 comments
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.
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`.What sorts of separation are beneficial for you? I'm wondering if I should switch, but I don't fully understand.
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.