[英]git Connection abandoned, fatal: Could not read from remote repository
我正在尝试使用Pageant的ssh密钥在cygwin或GitBash(msysgit)中克隆存储库。 我收到以下错误:
$ git clone git@github.com:username/your-project.git
Cloning into 'your-project'...
The server's host key is not cached in the registry. You
have no guarantee that the server is the computer you
think it is.
The server's rsa2 key fingerprint is:
ssh-rsa 2048 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48
Connection abandoned.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
但是,当尝试使用gitub调试ssh连接时,它表示可以正常工作
$ ssh -T git@github.com
Warning: Permanently added the RSA host key for IP address '192.30.252.129' to the list of known hosts.
Hi username! You've successfully authenticated, but GitHub does not provide shell access.
$ ssh-add -l
显示我的github个人资料中列出的相同指纹
所以问题不在于这里描述的问题: https : //help.github.com/articles/error-permission-denied-publickey
我在此页面上找到了解决方案http://www.bitsandpix.com/entry/git-setup-msysgit-install-with-pageantplink-from-putty/,但在此处重新创建该方法是希望它可以节省其他人的时间因为该页面没有轻易在Google中显示出来。
事实证明,要在cygwin / msysgit中充分使用选美,您首先需要使用腻子本身接受服务器的指纹。
只需启动腻子并连接到主机git@github.com
或git@bitbucket.org
,它将存储该指纹。 您将看到的是对腻子会话的简短闪烁,然后关闭。
现在回到cygwin或msysgit,您应该可以克隆了。
另外,如果您不想使用Pageant作为密钥,则必须取消设置环境变量GIT_SSH
,该变量指向plink.exe
并且cygwin / msysgit会自己接受服务器指纹(但是您将不再使用Pageant)。 这是在http://sourceforge.net/p/forge/site-support/2959/#204c中发现的
将GIT_SSH设置为使用TortoisePlink.exe
而不是PuTTY的plink.exe
。 这将允许弹出对话框窗口提示输入内容(例如,确认指纹或输入密码)。 如果通过Git使用plink.exe
,则无法键入对plink.exe提示的响应。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.