IDEA配置Git使用SSH协议,GIT版本兼容问题

错误描述

1:TortoiseGit小乌龟使用【ssh协议】拉取项目代码失败,仍可用http协议及https协议等拉取代码;
IDEA配置Git使用SSH协议,GIT版本兼容问题
IDEA配置Git使用SSH协议,GIT版本兼容问题

2:IDEA使用【ssh协议】拉取项目代码失败【此时IDEA配置GIT插件时,ssh文件选择为本地GIT的ssh文件】,好在IDEA2018.3设置ssh执行文件可改为IDEA内置SSH协议,可以拉取项目代码;
IDEA配置Git使用SSH协议,GIT版本兼容问题
但这并不能从根本上解决问题,而且IDEA不断更新,已经去掉切换为内置ssh执行文件的设置;

原因

IDEA提示错误,和 GIT BASH HERE 提示 基本相同:
IDEA配置Git使用SSH协议,GIT版本兼容问题
$ git clone ssh://[email protected]:xx/xxxx
Cloning into ‘xx’…
load pubkey “/c/Users/xx/.ssh/id_rsa”: invalid format
Unable to negotiate with [email protected] 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服务器较低版本,我本地git客户端版本2.23;
属于本地Git闹出的问题;

解决

在我本地GIT安装目录下
D:\XXXXXX\Git\etc\ssh\ssh_config

ssh_config文件的末尾加上
KexAlgorithms +diffie-hellman-group1-sha1
IDEA配置Git使用SSH协议,GIT版本兼容问题
加上之后,
本地 TortoiseGit小乌龟 即可 使用ssh协议拉取项目代码;
IDEA改为本地Git的ssh协议也可以拉取代码
IDEA配置Git使用SSH协议,GIT版本兼容问题
IDEA配置Git使用SSH协议,GIT版本兼容问题