【问题标题】:Git can't clone repositoryGit无法克隆存储库
【发布时间】:2013-07-25 08:33:47
【问题描述】:

我正在尝试连接到存储库,但尝试连接时总是收到此消息

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 c1:90:ff:d5:6b:78:33:5d:7b:ba:f6:f6:bc:1c:de:79
Connection abandoned.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

【问题讨论】:

  • 你的公钥在主机服务器上吗?
  • 是的,我已将公钥添加到主机服务器上的帐户中
  • 试试这个:*.com/questions/10166173/…问候,Udi
  • 我是windows系统所以sudo不会这样做
  • @Udi Cohen 我已经尝试过了,但它对我不起作用

标签: git


【解决方案1】:

尝试用ssh手动连接主机,确认并存储ssh指纹。在 Windows 上,使用可以为您处理此问题的结帐工具可能会有所帮助。据我所知,例如 Eclipse 可以。

【讨论】:

  • 不是一个完整的答案...更多评论
  • 你是怎么做到的?
  • 如果你在 linux 上:ssh username@server.如果你在 Windows... 使用 linux。
  • @ArnaudDenoyelle 确实对 Windows 用户很有帮助 :-( 对 stevedc 如果您使用的是 Windows,则需要安装 SSH 客户端(例如 Putty)并使用它。
【解决方案2】:

如果 ssh 对您不起作用,请尝试使用 http/https 进行克隆。

另一种解决方案(取决于您的 git“服务器”github/bitbucket/stash 等)将您的 ssh 密钥添加到“服务器”,它会起作用。

【讨论】: