Quick tip: using git with multiple ssh keys

Probably you are using git. And probably a day when you will add another repo is close. But standard git behavior is to use key located at ~/.ssh/id_rsa. And you just generated ~/.ssh/mynewkey and want to using for your gitserver.com host. So what to do? Just edit your ~/.ssh/config (if you don’t have it yes, create empty) and put:

And this is it, git clone should use mynewkey instead of id_rsa

Leave a Reply