title: Git Post-Receive Hook for Website Staging
body: <p>I'm trying to set up Git for staging my website so that I can <code>git pull</code> to get the current version to work on locally and then <code>git push</code> to push the changes to the remote server.  I've got it set up so that it works the way I want it to, but after I push, I have to manually run <code>git checkout -f</code> or <code>git reset --hard HEAD</code> on the remote server.</p>
  
  <p>I've tried putting these into a shell script as the post-receive hook on the server, but it just doesn't seem to have any effect.  I know that the script is running because I'm seeing "Changes pushed to server" after I push.  Here's the post-receive hook:</p>
  
  <pre><code>#!/bin/sh
  git reset --hard HEAD
  echo "Changes pushed to server."
  </code></pre>