1 git push 报错
git push origin HEAD:refs/for/*****
枚举对象中: 11, 完成.
对象计数中: 100% (11/11), 完成.
使用 16 个线程进行压缩
压缩对象中: 100% (5/5), 完成.
写入对象中: 100% (6/6), 571 字节 | 571.00 KiB/s, 完成.
总共 6(差异 3),复用 0(差异 0),包复用 0
remote: Resolving deltas: 100% (3/3)
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 ***@gerrit.***.com:hooks/commit-msg ${gitdir}/hooks/
remote: And then amend the commit:
remote: git commit --amend
remote:
To ssh://gerrit.***.com:29418/platform/***
2 执行提示命令继续报错
gitdir=$(git rev-parse --git-dir); scp -p -P 29418 yeliang1@gerrit.***.com:hooks/commit-msg ${gitdir}/hooks/
.git/hooks/: No such file or directory
3 解决方式
执行
git init
然后在执行
gitdir=$(git rev-parse --git-dir); scp -p -P 29418 yeliang1@gerrit.***.com:hooks/commit-msg ${gitdir}/hooks/
再执行
git commit --amend
3 补充
如果从一开始就没有hooks文件夹,可以把项目删了, 从新clone下。sourceTree克隆下来的项目默认不带这个hooks,使用git命令克隆下来的就可以。
版权声明:本文为SImple_a原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。