Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git hook not working

My git hook does not seem to be working. Namely a commit-msg hook from gerrit.

The commit-msg hook exist in <repo>/.git/hooks/ and has proper syntax.

like image 997
William Avatar asked Aug 30 '26 19:08

William


1 Answers

Make sure your hook files are executable. If you use i.e. curl to download hooks, make sure you chmod +x them.

$ pwd
<repo>/.git/hooks
$ chmod +x commit-msg

If you use scp to get your hooks, the flag -p might set proper modes for you.

like image 58
William Avatar answered Sep 02 '26 15:09

William



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!