gpt4 book ai didi

git 连接被放弃,致命的 : Could not read from remote repository

转载 作者:太空狗 更新时间:2023-10-29 12:56:22 25 4
gpt4 key购买 nike

我正在尝试使用 Pageant 作为 ssh key 在 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/但在这里重新创建希望它可以在将来节省其他人的时间,因为该页面没有轻易地显示在谷歌中。

事实证明,为了充分利用 cygwin/msysgit 的选美,您首先需要使用 putty 本身接受服务器的指纹。

只需启动 putty 并连接到主机 git@github.comgit@bitbucket.org 即可存储该指纹。您将看到的只是 Putty session 的短暂闪光,然后它关闭。

现在回到 cygwin 或 msysgit 中,您应该可以克隆了。

或者,如果您不想使用 Pageant 作为您的 key ,您必须取消设置指向 plink.exe 的环境变量 GIT_SSH 并且 cygwin/msysgit 将接受他们自己的服务器指纹(但您将无法再使用 Pageant)。这是在 http://sourceforge.net/p/forge/site-support/2959/#204c 发现的

关于git 连接被放弃,致命的 : Could not read from remote repository,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25138770/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com