解决 sourcetree git ssh私钥问题

最近遇到个问题,git仓库用gitbash,更新和提交都是没问题的,用界面化工具SourceTree就一直提示下面信息:

git -c diff.mnemonicprefix=false -c core.quotepath=false fetch origin
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.

后来在知乎找到参考方案,在此Mark一下。

步骤如下:

1、在SourceTree安装目录下找到PuTTy工具plink.exe,我的是在"D:Program Files (x86)AtlassianSourceTree oolsputty",运行命令 plink.exe root@192.168.1.104  -P port(192.168.1.104是我的仓库地址,请自行修改),遇到确认服务器公钥时,输入"y"即可。

2、如果上面走不通,点击SourceTree界面的 帮助 --> 关于查看下你的SourceTree版本是否高于0.8。如果是,点击 工具 --> 选项 --> git,检查一下是否使用系统安装的Git。如果是,使用内嵌的Git。确定后,重新拉取代码,弹出窗口,选择yes,什么都先别做,立刻切回使用系统安装的Git,现在可以正常使用SourceTree了。

 

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

欢迎转载,转载请注明作者:飘飞的夏秋 和出处 http://www.cnblogs.com/chenchenghua/p/7610882.html

原文地址:https://www.cnblogs.com/chenchenghua/p/7610882.html