ERROR: missing Change-Id in commit message footer
最近從Eclipse換到IDEA作為工作環境進行開發。我們公司用的是gerrit+git。進行代碼管理工作,idea上添加git?如果是默認路徑會自動添加上git,然后在gerrit上搜索gerrit插件,這里有個gerrit和git
當更改代碼后提交可以正常上master?之后push to gerrit則報下面的錯誤:
Delta compression using up to 4 threads.
Total 10 (delta 5), reused 0 (delta 0)
remote:?
remote: Processing changes: refs: 1 ? ? ? ?
remote: Processing changes: refs: 1, done ? ? ? ? ? ?
remote: ERROR: missing Change-Id in commit message footer ? ? ? ?
remote: Suggestion for commit message: ? ? ? ?
remote: 測試idea提交 ? ? ? ?
remote:?
To ssh://r170004@172.16.1.124:29418/vcheck/vcheck-portal
remote: Signed-off-by: r170004 <yu.ren@gareatech.com> ? ? ? ?
!?? ?refs/heads/master:refs/for/master?? ?[remote rejected] (missing Change-Id in commit message footer)
remote:?
remote: Change-Id: I6ae28295785999f7dc99a3840f1a3e1b8383fbee ? ? ? ?
remote:?
remote: Hint: To automatically insert Change-Id, install the hook: ? ? ? ?
remote: ? scp -p -P 29418 r170004@gls2.local:hooks/commit-msg .git/hooks/ ? ? ? ?
remote:?
remote:?
error: failed to push some refs to 'ssh://r170004@172.16.1.124:29418/vcheck/vcheck-portal'
?
處理方式:
1、?在idea?的Teminal?執行 ,給當前idea的項目添加?執行scp命令是從gerrit代碼服務器上將鉤子腳本文件commit-msg下載到項目的鉤子目錄下
2、在Temianl下對提交進行修改,將change-id追加到提交的地方:
? ? ? ? ?git commit --amend?執行后會進入提交message,添加change-id
3、推送代碼到服務器上:
? ? ? ? ? git push origin HEAD:refs/for/master? (我這里推送到master分支上)
?
這樣就可以了。主要是因為chang-id在提交時沒有?而gerrit要求每個提交都要有chang-id?所以加上就可以了。
?
與50位技術專家面對面20年技術見證,附贈技術全景圖總結
以上是生活随笔為你收集整理的ERROR: missing Change-Id in commit message footer的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 关闭页面刷新上层页面的几种方式
- 下一篇: gerrit的Change-Id机制和h