$ git push origin master:refs/for/master
Counting objects: 12, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (7/7), done.
Writing objects: 100% (12/12), 988 bytes | 0 bytes/s, done.
Total 12 (delta 4), reused 0 (delta 0)
remote: Resolving deltas: 100% (4/4)
remote: Processing changes: refs: 1, done
remote: ERROR: [e3d0821] 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 minghua.zhang@gerrit01.fihbdc.com:hooks/commit-msg ${gitdir}/hooks/
remote: And then amend the commit:
remote: git commit --amend
remote:
To ssh://minghua.zhang@gerrit01.fihbdc.com:29418/APP/NoteWidget
! [remote rejected] master -> refs/for/master ([e3d0821] missing Change-Id in commit message footer)
Counting objects: 12, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (7/7), done.
Writing objects: 100% (12/12), 988 bytes | 0 bytes/s, done.
Total 12 (delta 4), reused 0 (delta 0)
remote: Resolving deltas: 100% (4/4)
remote: Processing changes: refs: 1, done
remote: ERROR: [e3d0821] 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 minghua.zhang@gerrit01.fihbdc.com:hooks/commit-msg ${gitdir}/hooks/
remote: And then amend the commit:
remote: git commit --amend
remote:
To ssh://minghua.zhang@gerrit01.fihbdc.com:29418/APP/NoteWidget
! [remote rejected] master -> refs/for/master ([e3d0821] missing Change-Id in commit message footer)
error: failed to push some refs to 'ssh://minghua.zhang@gerrit01.fihbdc.com:29418/APP/NoteWidget'
问题原因:
git clone 代码命令出错了,导致无hook
解决方法:
执行
scp -p -P 29418 minghua.zhang@gerrit01.fihbdc.com:hooks/commit-msg .git/hooks/
git commit --amend
git push ...