I need to check each commit coming into GitLab and block any of them which have a certain file in. I used the documentation here
I have created a file named pre-receive in the .git/custom_hooks directory.
The file just has the contents:
#!/bin/sh
exit 1
Which, I believe, should reject any attempt to push code to the repo (?)
The file is owned by git and is executable:
ls -a gives the response:
-rwxrwxrwx 1 git root 550 ...
The custom_hooks directory is also executable and owned by the git user.
But all commits go through without issue, the commit hook does not seem to activate in any way.
I do not see anything else in the documentation that I am supposed to do. Have I missed anything?