TortoiseGit - 多个GitHub存储库,每个存储库都有不同的密钥对 [英] TortoiseGit - Multiple GitHub repositories with different key pairs each

查看:441
本文介绍了TortoiseGit - 多个GitHub存储库,每个存储库都有不同的密钥对的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有3个 GitHub 版本库:{repo1,repo2,repo3},每个版本的公钥不同于部署密钥

在远程Linux服务器上(我通过本地Windows 7计算机上的PuTTY连接到它)我配置了所有这些存储库文件:〜/ .ssh / config 按照本指南操作:



如果我创建一个用于repo1的密钥对并将其设置在GitHub上,远程Linux服务器和本地Windows 7计算机正常工作。但是,如果我对repo2执行相同的操作,那么如果我尝试用GitHub进行连接(远程Linux服务器继续工作),那么使用TortoiseGit的本地Windows 7将显示以下错误:

一个href =https:// stac koverflow.com/a/32115724/3906760\">https://stackoverflow.com/a/32115724/3906760 )。



3)使用https与一个凭证助手并将用户名放入URL中,如 https://username@example.com/path (另请参阅https://stackoverflow.com/a/34611311/3906760 )。


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.

解决方案

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

这篇关于TortoiseGit - 多个GitHub存储库,每个存储库都有不同的密钥对的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆