问题:
git和gerrit对接,git commit的时候都提示“missing Change-Id in commit message footer”。知道是因为change-id搞的鬼,也知道从gerrit上或者其他地方拷个commit-msg脚本儿,放到.git/hooks目录下就完事儿了。但是,每次重新克隆时,就有得再来一遍拷贝动作,很低效。
注:
单仓拷贝,不用repo。
方法:
部署本地全局Hook即可:
- $mkdir -p ~/.git_template/hooks
- $cp commit-msg ~/.git_template/hooks
- $git config --global init.templatedir ~/.git_template
参考:
http://git-scm.com/docs/git-config.html
https://git-scm.com/book/en/v2/Customizing-Git-Git-Configuration
版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/cuiaamay/article/details/49001909