一个git pull无法使用的问题

     之前通过git管理的一个项目,今天直接用eclipse通过ssh加入工程后,每次通过git命令行pull代码都报以下错误:

Unable to negotiate with 21.12.1.167 port 29418: 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 server和client使用的ssh key解析算法不一致造成的,client因为系统升级的原因默认使用新的key exchange method而服务器只提供diffie-hellman-group1-sha1方法,因此无法正常建立链接。
解决的方案是在.ssh目录下面新建一个config文件并在config文件中添加以下代码。

Host xx.xx.x.xxx
    KexAlgorithms +diffie-hellman-group1-sha1

其中 xx.xx.x.xxx为服务器的ip地址或者域名,这个config文件可以通过.git文件夹下的复制后修改。

转载于:https://www.cnblogs.com/zhansu/p/8878191.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值