title: Gitlab custom hook not running
body: <p>We have Gitlab installed on the same server as a dev/staging copy of our test project. Two of us have local working copies with Gitlab as a remote, and are able to push/pull to Gitlab successfully. We also have Gitlab set as a remote in the staging copy of the project, and pulling from Gitlab works there manually as well.</p>
  
  <p>However, when creating a custom hook for Gitlab (as described <a href="http://doc.gitlab.com/ce/hooks/custom_hooks.html" rel="nofollow">here</a>), the hook simply fails to run with no errors. The content of the hook is:</p>
  
  <pre><code>#!/bin/bash
  
  echo "Inside post_receive hook"
  cd /path/to/staging/copy
  git pull gitlab master
  </code></pre>
  
  <p>...where <code>/path/to/staging/copy</code> is the staging location of the project. Here's the ownership &amp; permissions of the hook:</p>
  
  <p><code>-rwxr-xr-x. 1 git git 114 Mar 30 10:28 post_receive</code></p>
  
  <p>When pushing from my working copy to Gitlab, this hook should run, but it doesn't -- the staging copy is not updated, the echo message isn't shown, and the push results message doesn't show any errors.</p>
  
  <p>I have tried a few tips from SO answers regarding setting/unsetting environment variables, and they didn't help. I'm out of ideas. Does anyone know why the custom hook isn't running?</p>