I am using the Gitolite to create the git repo.
I have requirement that when user push something to repo it must have some specific file (eg. .md file) otherwise don't let push the code.
So now I need to configure a post-push hook and do some operation on pushed content.
Can any one please help me to do the same?
First, I would not recommend gitosis (old and obsolete).
Second, this is a job for a
VREF(update hooks in Gitolite lingo).You can use in that
VREFadiff --name-onlyordiff --name-status:(See shell explained)
If the list doesn't include your
.mdfile, you would exit with a non-zero status, and thegit pushwould be denied.