問題:
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