您的位置:首页 > 其它

解决git提交到gerrit ERROR: missing Change-Id in commit message footer 问题

2016-10-25 16:39 639 查看

解决git提交到gerrit ERROR: missing Change-Id in commit message footer 问题

出现该问题的原因是 执行 git commit 没有生成 Change-Id 或者是从本地分支合并过来的,但是 提交 gerrit必须要有 Change-Id ,否则会被拒绝.其实错误信息已经提示如何解决该问题:

Resolving deltas: 100% (10/10)
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 rgchen@10.0.0.234:hooks/commit-msg ${gitdir}/hooks/
remote: And then amend the commit:
remote:   git commit --amend
remote:


解决办法:

install the hook 让每次提交自动插入 Change-Id 安装方法提示的有: gitdir=(gitrev−parse–git−dir);scp−p−P29418rgchen@10.0.0.234:hooks/commit−msg{gitdir}/hooks/

重新更新提交信息 git commit –amend “这里写更新注释”

然后重新 upload 或者 push

附上git merge 方式:

git merge branch_name fast-farward merge

git merge –no-ff branch_name 会执行正常合并

参考文章:

代码合并:Merge、Rebase的选择

git merge简介
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息