Automatically placing Gerrit’s commit-msg hook in every new git repository

Sadly, when cloning a repository from Gerrit. the Gerrit’s commit-msg hook is not populated in the local repository git hooks folder.

Here’s a neat trick that I just learned that always puts that there.

scp -p -P 29418 <GERRIT_SERVER>:hooks/commit-msg ./
sudo mv ./commit-msg /usr/share/git-core/templates/hooks/

Hope you find it useful…

Advertisements
Automatically placing Gerrit’s commit-msg hook in every new git repository

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s