gerrit +git + windows 配置常见问题总结

Git 正常安装 配置 ssh-keygen 后,git clone 服务器代码报错

clone 报错1

no matching key exchange method found. Their offer: **diffie-hellman-group1-sha1**

clone 报错2

no matching host key type found. Their offer: ssh-rsa

解决方案

用户目录文件下.ssh,新建 config 文件

Host *
    KexAlgorithms +diffie-hellman-group1-sha1
	HostkeyAlgorithms +ssh-dss,ssh-rsa
    PubkeyAcceptedKeyTypes +ssh-dss,ssh-rsa

提交代码报错

Git missing Change-Id in commit message footer

解决方案

使用git bash 工具进入,根据提示输入

gitdir=$(git rev-parse --git-dir); scp -p -P xxx xxx@xxx:hooks/commit-msg ${gitdir}/hooks/
git commit --amend

如果执行时提示如下错误,参考错误解决方案

subsystem request failed on channel 0
scp: Connection closed

解决办法:将提示方法中的scp -p改为scp -O,问题解决

gitdir=$(git rev-parse --git-dir); scp -O -P xxx xxx@xxx:hooks/commit-msg ${gitdir}/hooks/

问题原因:try to use -O option with scp. This solved the same issue in my case with 9.0p1. It forces to use the legacy SCP protocol for file transfers instead of the SFTP protocol. Use of the SCP protocol may be necessary for servers that do not implement SFTP, for backwards-compatibility for particular filename wildcard patterns and for expanding paths with a ‘~’ prefix for older SFTP servers. Found here

你可能感兴趣的:(git)