TortoiseGit - Multiple GitHub repositories with different key pairs each

6.7k views Asked by At

I have 3 GitHub repositories: {repo1, repo2, repo3}, each one with a different public key as Deploy key under each repository settings.

On a remote Linux server (I connect to it via PuTTY from my local Windows 7 machine) I have all these repositories configured with the file: ~/.ssh/config following this guide:

https://gist.github.com/jexchan/2351996

They works perfectly there, so don't worry about that.

My problem is on my local computer, where I'm using Windows 7 with TortoiseGit.

For each repository I have TortoiseGit configured like below:

enter image description here

If I create a key pair for the repo1 and set it up on GitHub, the remote Linux server and my local Windows 7 machine works properly. But if I do the same for repo2 then my local Windows 7 with TortoiseGit shows up the following error if I try to connect somehow with GitHub (remote Linux server keeps working):

enter image description here

It is like when I configure a new GitHub repo with TortoiseGit the previous configurations messed up.

The remote Linux server always keep working.

1

There are 1 answers

0
MrTux On BEST ANSWER

You have several options:

1) Use PuTTY sessions as described in https://stackoverflow.com/a/29183147/3906760 and the TortoiseGit FAQ

2) Use OpenSSH as SSH client (see https://stackoverflow.com/a/32115724/3906760).

3) Use https with a credential helper and put the username into the URL like https://[email protected]/path (also see https://stackoverflow.com/a/34611311/3906760).