I have to admit I do not fully understand how githooks on the server are supposed to work.
After installation of githooks on the server with
sh -c "$(curl -fsSL https://raw.githubusercontent.com/rycus86/githooks/master/install.sh)" -- --only-server-hooks
and automatic or manual installation of githooks in all repositories on the server, I see that each repository's hook directory contains the appropriate template hooks.
Question is: How do I use these hooks?
I created a hook/.githooks/pre-receive hook script in one of the bare repositories on the server, similar to a script in the .githooks directory of a work tree in a user's local (obviously non-bare) repository, but it did not get called upon a user's "git push".
My use case is that for each repository on the server, I want the individual choice of running multiple server-side hooks each time a user does a "git push". These hooks should enforce various policies (some of them different for each repository) without a user having a chance of getting around them (e.g. by manipulating them in a local repository's .githooks directory). So my requirements are:
If githooks is not "the right tool for the job", please let me know, but now that I got your wonderful hammer, every git problem looks like a nail. :-}
Also let me know if I missed the whole thing in the documentation by pointing me to the right location and sending me a cone of shame. :)
I have to admit I do not fully understand how githooks on the server are supposed to work.
After installation of githooks on the server with
and automatic or manual installation of githooks in all repositories on the server, I see that each repository's
hookdirectory contains the appropriate template hooks.Question is: How do I use these hooks?
I created a
hook/.githooks/pre-receivehook script in one of the bare repositories on the server, similar to a script in the .githooks directory of a work tree in a user's local (obviously non-bare) repository, but it did not get called upon a user's "git push".My use case is that for each repository on the server, I want the individual choice of running multiple server-side hooks each time a user does a "git push". These hooks should enforce various policies (some of them different for each repository) without a user having a chance of getting around them (e.g. by manipulating them in a local repository's .githooks directory). So my requirements are:
hooksdirectory will never get transferred to a user's local repository)..sharedfile)..githooksin a local repository.If githooks is not "the right tool for the job", please let me know, but now that I got your wonderful hammer, every git problem looks like a nail. :-}
Also let me know if I missed the whole thing in the documentation by pointing me to the right location and sending me a cone of shame. :)