TortoiseGit - Multiple GitHub repositories with different key pairs each

拟墨画扇 提交于 2020-01-11 12:53:13

问题


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:

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):

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:


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://username@example.com/path (also see https://stackoverflow.com/a/34611311/3906760).



来源:https://stackoverflow.com/questions/41291043/tortoisegit-multiple-github-repositories-with-different-key-pairs-each

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!