git服务器的主机密钥未缓存在注册表中

时间:2016-04-16 04:45:15

标签: git ssh rsa

我尝试将更改从我的本地仓库转移到远程仓库。当我输入

git pull origin hubert

我收到以下错误:

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 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx
Connection abandoned.
fatal: Could not read from remote repository.

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

但是当我输入

ssh hubert@remove_host

工作正常。

我使用Windows 7 32 bits并且我在目录中有相同的文件:

  • C:\ Users \ hubert \ .ssh
  • C:\ Users \ hubert \ AppData \ Local \ VirtualStore \ Program Files \ Git \ .ssh

感谢您的帮助。

1 个答案:

答案 0 :(得分:1)

检查$GIT_SSH的值(在git-bash会话中):如果它涉及plink.exe,则不会使用$HOME/.ssh/known_host(已包含原始服务器,因为手动ssh工作)

您可以配置plink:

plink.exe hubert@remote_host
# answer 'y'

或者您可以设置git to use openssh