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

在执行git clone命令报错

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

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

解决:

# export GIT_SSH_COMMAND='ssh -o KexAlgorithms=+diffie-hellman-group1-sha1'

这种方法每次新开git窗口,都需要重新输入export GIT_SSH_COMMAND

避免的方式就是打开.bashrc文件,在终端输入:$ vim ~/.bashrc  ,然后向.bashrc文件写入

export GIT_SSH_COMMAND='ssh -o KexAlgorithms=+diffie-hellman-group1-sha1'

完毕

 

posted @ 2018-10-27 20:23  温柔的风  阅读(2815)  评论(0)    收藏  举报