My setup is a windows XAMPP server, with cURL enabled, and Git and Hudson installed. Hudson polls Git every minute to look for changes, and if it finds them, it creates a build. I use this build as my testing server. This works fine.
I would like to set up a post-receive hook on my central remote repository that runs the force build function of Hudson.
I've created a post-receive file called "post-receive" in the hooks directory in my central Git repository, the one that is pushed to from the developers' local branches. They each push to their own branch on the central repository. I want to run the post-receive build immediately after every push, instead of having Hudson poll Git every minute.
When I open a shell to the remote server and run "post-receive" in the hooks folder, it runs. It just isn't being called when people push to it from their local repository copies to the central one.
Maybe I'm not explaining this right, but it's how I understand Git.
The post-receive code is two lines:
It executes on the remote repository once after all the refs have been updated.
All of these answers are useful, but it turns out I needed the "bin" directory of git in my PATH variable. I had the "cmd" directory only. Added
c:\my_path_to_git\git\bin to PATH and it works fine. I found this answer by trial and error and looking at the apache error log. Thank you all for your help!