前因

前几天在公司还了一台电脑,重新安装了开发环境,然后用 SourceTree 推代码的时候报错了,想起来上一台电脑刚用的时候也出现过这个问题,所以记录一下。

错误信息

git -c diff.mnemonicprefix=false -c core.quotepath=false --no-optional-locks fetch --no-tags origin

The host key is not cached for this server:

gitee.com (port 22)

You have no guarantee that the server is the computer

you think it is.

The server's ssh-ed25519 key fingerprint is:

ssh-ed25519 255 SHA256:+ULzij2u99B9eWYFTw1Q4ErYG/aepHLbu96xxxxxxxxx

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, Return cancels connection, i for more info)

解决办法

选择【工具】,然后点击【选项】。 然后在【SSH客户端】更换成 openSSH ,然后就可以推拉代码了。