Git提交错误解决:missing Change-Id in message footer
问题现象:
提交的commit中没有插入change id导致push代码失败。
问题解决:
针对该错误,Git已经给出了解决方案:
1、to automatically insert a Change-Id, install the hook:
gitdir=$(git rev-parse --git-dir); scp -p -P 29418 xxx@xxx:hooks/commit-msg ${gitdir}/hooks/
注意:
a、调用上面指令安装,填入自己对应的服务器地址,正常环境下是会安装成功的。
b、如果是公司的内网,则会有对应的安装脚本去安装commit-msg,相应的公司会留有操作指南。
c、没有找到对应操作指南,则直接找到对应能push成功的SDK文件夹,在.git/hooks/文件夹下找到commit-msg脚本,直接复制粘贴到push失败的SDK文件夹对应的.git/hooks/文件夹下。
2、remote: and then amend the commit:
git commit --amend --no-edit
注意:1步骤成功后调用2步骤指令,不需要改动代码,就可以生成一个新的插入了change id的commit。
3、重新git push。