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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值