Window Git配置

目录

安装Git

配置ssh

下载代码

提交代码报错



安装Git

官网地址:  Git  下载对应系统的版本Git软件。

按照默认参数一步一步进行安装

配置ssh

安装完毕后,鼠标右键,打开 Git Bash窗口

ssh-keygen 生成ssh key,生成目录为 c/user/xx/.ssh/目录

将key添加  ssh-add  -K  ~/.ssh/id_rsa

报错: Could not open a connection to your authentication agent

解决办法:

先执行如下命令 ssh-agent bash
然后再执行 ssh-add ~/.ssh/id_rsa

下载代码

git clone xxx

两种不同的报错信息 :

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

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

解决办法:

在~/.ssh/目录下(C:\Users\用户名\.ssh\)新建文件 config文件
写入如下内容:

Host *

KexAlgorithms +diffie-hellman-group1-sha1
HostkeyAlgorithms +ssh-rsa
PubkeyAcceptedKeyTypes +ssh-rsa

重新拉取代码即可。

提交代码报错

没有生成commit id。按照提示

remote: Processing changes: refs: 1, done
remote: ERROR: missing Change-Id in commit message footer
remote:
remote: Hint: To automatically insert Change-Id, install the hook:
remote:   gitdir=$(git rev-parse --git-dir); scp -p -P 29418 lipan@review.rnd.meizu.com:hooks/commit-msg ${gitdir}/hooks/
remote: And then amend the commit:
remote:   git commit --amend

按照提示进行操作时,报错

$ gitdir=$(git rev-parse --git-dir); scp -p -P 29418 lipan@review.rnd.meizu.com:hooks/commit-msg ${gitdir}/hooks/
subsystem request failed on channel 0
scp: Connection closed

解决办法:将提示方法中的scp -p改为scp -o

gitdir=$(git rev-parse --git-dir); scp -O -P 29418 lipan@review.rnd.meizu.com:hooks/commit-msg ${gitdir}/hooks/
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

专注和坚持是最好的导师

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值