Git missing Change-Id in commit message footer解决方法
missing Change-Id in commit message footer
- 原因:项目仓库.git/hooks目录下,commit-msg文件缺失。
- 解决方法1:一般在提交代码报错时,会给出相应解决的提示。
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 xxxxx@xxxx:hooks/commit-msg ${gitdir}/hooks/
remote: And then amend the commit:
remote: git commit --amend
- 如上所示,依次在项目路径下输入如下命令,即可解决:
gitdir=$(git rev-parse --git-dir);
scp -p -P 29418 xxxxx@xxxx:hooks/commit-msg ${gitdir}/hooks/
git commit --amend
- 解决办法2:其实和上面的办法差不多,如果将当前项目留有备份,直接将备份项目的.git/hooks/commit-msg拷贝到,当前项目相应目录即可。
Git系列