Comment

Comment by neilpa

You 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`.
parent neilpa 6 years ago

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton