Create Change Id in git commit message for Gerrit review automatically - lifuzu/cafe GitHub Wiki
- Create a folder, e.g. ~/.git/templates/hooks;
mkdir -p ~/.git/templates/hooks- Download git hooks here: https://gist.github.com/lifuzu/5985927 and put them into ~/.git/templates/hooks;
- Add the following BOLD section in ~/.gitconfig:
[color]
ui = auto
[user]
name = USERNAME
email = EMAIL
**[init]**
**templatedir = ~/.git/templates**
- Try to have a new git clone, check the folder .git/hooks under the local repo folder, it should be like this:
ls -ls .git/hooks/
total 12
8 -rwxrwxr-x 1 user user 4252 Jun 17 16:13 commit-msg
4 -rwxrwxr-x 1 user user 1646 Jun 17 16:13 pre-auto-gc