Git clone失败的解决方法

来源:互联网 发布:国家打击网络暴恐信息 编辑:程序博客网 时间:2024/05/22 09:39

问题描述


新配置的Git Bash客户端去克隆服务器的工程时出现如下错误:


Unable to negotiate with xxx port xxx:no matching key exchange method found.Their offer: diffie-hellman-group1-sha1

fatal:Could not read from remote repository.

 

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


错误截图如下:





解决方法


找到安装的Git客户端ssh的配置文件,我安装的是Git Bash 2.10.2版本,安装之后配置文件在D:\Program Files\Git\etc\ssh目录下的ssh_config文件里面,用记事本或者UE工具打开该文件,在里面添加如下内容:

Host 192.168.8.163KexAlgorithms +diffie-hellman-group1-sha1

注意:192.168.8.163 是服务器的地址,要根据你自己服务器的地址进行修改,上面地址是我这边服务器的地址,别直接复制上。

 

按照上述方式修改完之后保存修改,然后重新打开Git Bash,就可以克隆代码了。操作截图如下:




这样,问题就可以成功解决了。



0 0
原创粉丝点击