I’ve searched several questions here and haven’t been able to get the answer, so I’ll ask regarding my specific situation.
Real simple post-receive hook, it just curls to Redmine to force Redmine to update the views of the repo on commit. (For sake of debugging I’m also echo’ing “Post Receive Hook Go” to see
Setup:
Bare Repo /git/repos/test.git
$ cd ~/
$ git clone file:///git/repos/test.git
$ cd test/
$ vim somefile_gets_updated
$ git commit -a -m 'Tackling bug #1, include the bug number so Redmine will pick it up and associate it'
$ git push origin master
This commits and pushes as expected, but the post-receive hook does not fire
If I do
$ curl http://localhost:3000/sys/fetch_changesets?key=cGdcUaRr8u4Rr4zXzXhr and refresh my redmine issue page it works, hooray!
If after the push I do:
$ ./.git/hooks/post-receive
I get:
$ Post Receive Hook Go
It works, hooray!
So I know the curl works, even the post-receive works, Git just doesn’t fire it
This is the hooks
$ cd .git/hooks
$ ls -l | grep post-receive
$ -rwxr-xr-x 1 bobbydown staff 109 Dec 22 03:42 post-receive
I just don’t understand why git isn’t running the hook…
The post-receive hook fires after a repo receives pushed commits.
In your scenario, your hook should be in your bare repo, not the clone.