拉取服务器代码(clone )
1、执行:git clone ssh:xxxxxx && scp -p -P 29418 xxxxxxxxx
1、报错:Unable to negotiate with XX.XX.XX.XX port XX:: no matching key exchange method found. Their offer: diffie-hellman-group1-sha1
fatal: Could not read from remote repository.
问题解决:进入本机 .ssh目录,在下面新建一个config文件,不带后缀名,配置如下
Host *
KexAlgorithms +diffie-hellman-group1-sha1
2、再次执行:git clone。。。
2、报错: Unable to negotiate with xxxxxxx port 29418: no matching host key type found. Their offer: ssh-rsa,ssh-dss
问题解决:config文件增加下面两条
Host *
KexAlgorithms +diffie-hellman-group1-sha1
HostkeyAlgorithms +ssh-rsa
PubkeyAcceptedAlgorithms +ssh-rsa
参考:
解决:no matching key exchange method found. Their offer: diffie-hellman-group1-sha1_zombres的博客-CSDN博客
Git Bash - ssh连接问题答案 - 爱码网
提交代码(push)
1、执行: git push origin HEAD:refs/for/master
1、报错:missing Change-Id in commit message footer
问题解决:执行第二个红框的代码
2、执行上面代码
2、再次执行报错:
subsystem request failed on channel 0.
scp:Connection closed
问题解决:将scp -p -P改为scp -O(大写) -P即可
第二个红框的代码执行成功。
3、执行:git commit --amend
3、再次执行报错:
hint: Waiting for your editor to close the file... C:\Program Files (x86)\Notepad++\notepad++.exe: -c: line 1: syntax error near unexpected token `('
C:\Program Files (x86)\Notepad++\notepad++.exe: -c: line 1: `C:\Program Files (x86)\Notepad++\notepad++.exe "$@"'
error: There was a problem with the editor 'C:\Program Files (x86)\Notepad++\notepad++.exe'.
问题解决:执行
git config --global core.editor "'C:/Program Files (x86)/Notepad++/notepad++.exe' -multiInst -notabbar -nosession -noPlugin '$*'"
会通过notepad打开文件,不需要做任何改动,直接退出即可。
参考:
记录一次git 提交代码出现的问题_gitdir=$(git rev-parse --git-dir) : 无法将“gitdir=$(g_何小白besthyq的博客-CSDN博客
Git Bash 设置Notepad++作为默认编辑器_actionPig的博客-CSDN博客
执行git log,生成Change-Id。再次push,成功。