title: Git post-receive hook not working
body: <p>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.</p>
  
  <p>I would like to set up a post-receive hook on my central remote repository that runs the force build function of Hudson.</p>
  
  <p>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.</p>
  
  <p>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.</p>
  
  <p>Maybe I'm not explaining this right, but it's how I understand Git.</p>
  
  <p>The post-receive code is two lines:</p>
  
  <pre><code>#!/bin/sh
  curl http://myserver.com:8080/hudson/job/myjobname/build?token=mytoken
  </code></pre>
  
  <p>Again, when I open a shell and run this, it works, but when someone pushes to it, nothing happens, until a minute or less goes by, Hudson realizes that Git was changed, and then it builds.</p>
  
  <p>I am happy to clarify if need be. Any help is greatly appreciated.</p>
  
  <p>EDIT: After playing around with it, I feel like maybe post-receive isn't executing because refs aren't being updated of something? The git documentation says</p>
  
  <blockquote>
    <p>It executes on the remote repository once after all the refs have been updated.</p>
  </blockquote>
  
  <p>Does this mean if nothing updates, it won't execute? And if so, I'm pretty sure things are updating anyway so it shouldn't apply.</p>
  
  <p>Here's my process:
  Make edits locally.
  Commit edits.
  Push from my HEAD to the remote branch called 'mybranch' (not the master branch, which is checked out)
  This is the point at which I want my hook to execute.</p>