0


git提交push提示没有change id解决办法

error:missing Change-Id in commit message footer

git push的时候出现以上提示,在这个代码下方会有解决方法提示或者自己git log查看有没有id

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

解决方法

1、git bash里复制代码,

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

回车提交会在.git/hooks里生成commit-msg 文件,

一般没有问题,但是自己这时候出现了报错

subsystem request failed on channel 0 
scp: Connection closed

查找了解决办法,把scp -p改为scp -o,问题解决(不是零 是字母o)

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

2、之后在使用git commit --amend这代表修改刚刚没有changeid的commit内容

我不需要修改什么,可以直接:wq退出保存

3、如果不使用git commit --amend或者自己commit的好几次都没有change id 那可以使用回滚

git reset --soft HEAD^ git reset --soft 回滚到哪一次commit

4、使用了回滚需要在commit一次,然后在push

  使用git commit --amend的直接push 

如果不放心在push之前可以在git log查看

标签: git github

本文转载自: https://blog.csdn.net/m0_69056719/article/details/127225946
版权归原作者 骑着蜗牛漂移666 所有, 如有侵权,请联系我们删除。

“git提交push提示没有change id解决办法”的评论:

还没有评论