On my remote box, I've initialized a bare git repository. In the hooks directory, I've initialized the post-receive, post-update and update hooks with the following script:
#!/bin/bash
echo $0 $@ >> /tmp/githooks.log
On my local box, I've cloned the repository, added a test file, committed it and pushed the change back to the remote box.
$ git clone https://remote/git/sandbox.git sandbox
$ cd sandbox
$ touch asdf
$ git add asdf
$ git commit -a
[master (root-commit) 37505de] zxcv
0 files changed, 0 insertions(+), 0 deletions(-)
create mode 100644 asdf
$ git push origin master
Fetching remote heads...
refs/
refs/heads/
refs/tags/
updating 'refs/heads/master'
from 0000000000000000000000000000000000000000
to 37505de9c22b0aee84e0071190f4f58728770675
sending 3 objects
done
Updating remote server info
To https://remote/git/sandbox.git
* [new branch] master -> master
However, /tmp/githooks.log is empty on the remote machine. If, however, I clone the repository while on the remote machine, the hooks are successfully called.
Do git hooks not work with http-push?