GIT 错误 remote: ERROR: [20c4984] missing Change-Id in commit message footer

错误:

$ git push origin HEAD:refs/for/dev%r=
Counting objects: 32, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (28/28), done.
Writing objects: 100% (32/32), 3.35 KiB | 0 bytes/s, done.
Total 32 (delta 21), reused 0 (delta 0)
remote: Resolving deltas: 100% (21/21)
remote: Processing changes: refs: 1, done
remote: ERROR: [20c4984] 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@gerrit.com.cn:hooks/commit-msg ${gitdir}/hooks/
remote: And then amend the commit:
remote: git commit --amend
remote:
To ssh://gerrit..com.cn:29418/
! [remote rejected] HEAD -> refs/for/dev%r= ([2 0c4984] missing Change-Id in commit message footer)
error: failed to push some refs to 'ssh:'

 

解决办法:

第一步 上面的给出了解决方案:

gitdir=$(git rev-parse --git-dir); scp -p -P 29418@gerrit.com.cn:hooks/commit-msg ${gitdir}/hooks/

备注(弹出页面退出方法

:wq  回车

第二步:

git commit --amend

 

posted @ 2019-06-04 16:13  二零一七  阅读(1171)  评论(0)    收藏  举报