尝试克隆 git 存储库后 Win 控制台挂起
Win console hangs after trying to clone a git repo
我有一个要克隆的远程仓库。我已经设置 pageant.exe 并添加了私钥。还添加了指向 plink.exe 的 GIT_SSH 变量。在克隆命令之后我得到这样的输出
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.
...
If you trust this host, enter "y" to add the key to
PuTTY's cache and carry on connecting.
If you want to carry on connecting just once, without
adding the key to the cache, enter "n".
If you do not trust this host, press Return to abandon the
connection.
Store key in cache? (y/n)
当键入 y
或 n
时没有任何反应,控制台只是挂起,我必须使用 Ctrl+C
终止命令
为什么会发生这种情况以及如何解决这个问题?
经过几个小时的调查,我终于找到了解决办法。
putty 必须知道你要连接的主机,即主机必须是 known_host
到 putty。 Putty 将有关 know_hosts
的信息存储在
HKEY_CURRENT_USER\SoftWare\SimonTatham\PuTTY\SshHostKeys
注册表项。要强制腻子将有关该主机的信息添加到注册表项,我们可以使用您的私钥通过 putty.exe 进行访问。第一次访问时,putty 会要求您将该主机添加到 known_hosts
。之后 git clone 命令成功完成。
也许这对某些人有帮助,因为乍一看并不明显
我有一个要克隆的远程仓库。我已经设置 pageant.exe 并添加了私钥。还添加了指向 plink.exe 的 GIT_SSH 变量。在克隆命令之后我得到这样的输出
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.
...
If you trust this host, enter "y" to add the key to
PuTTY's cache and carry on connecting.
If you want to carry on connecting just once, without
adding the key to the cache, enter "n".
If you do not trust this host, press Return to abandon the
connection.
Store key in cache? (y/n)
当键入 y
或 n
时没有任何反应,控制台只是挂起,我必须使用 Ctrl+C
为什么会发生这种情况以及如何解决这个问题?
经过几个小时的调查,我终于找到了解决办法。
putty 必须知道你要连接的主机,即主机必须是 known_host
到 putty。 Putty 将有关 know_hosts
的信息存储在
HKEY_CURRENT_USER\SoftWare\SimonTatham\PuTTY\SshHostKeys
注册表项。要强制腻子将有关该主机的信息添加到注册表项,我们可以使用您的私钥通过 putty.exe 进行访问。第一次访问时,putty 会要求您将该主机添加到 known_hosts
。之后 git clone 命令成功完成。
也许这对某些人有帮助,因为乍一看并不明显