title: Can't execute git commands in gitolite post-receive hook
body: <p>I really can't figure out why this happens.</p>
  
  <p>In my system I got the 'git' user with gitolite. All git repos, users and permissions for the repos work just fine, it seems gitolite is configured okay at least for a basic use.</p>
  
  <p>Now I needed to set up a webserver on the machine with gitolite, I set up apache and, with the git user, I cloned a repo in the www directory so that I could access the files via browser.</p>
  
  <p>No problems at all with the cloning, I also can manually do a <code>git pull</code> and git will pull from the repo.</p>
  
  <p>The issue is when I try to automatically deploy the project to the www directory everytime a user pushes. I wrote a ~/.gitolite/hooks/common/post-receive script and the code is the following:</p>
  
  <pre><code>#!/bin/sh
  dir=/var/www/onlinerepo
  if [ ! -d $dir ] ; then
          echo "the directory $dir does not exist"
          exit 1
  fi
  
  cd $dir
  git pull
  touch DONE
  </code></pre>
  
  <p>I also did a <code>gl-setup</code> to propagate the script to all the repositories.
  When a user pushes, I'm sure the script is executed because I see the /var/www/onlinerepo/DONE file getting written, but no <code>git pull</code> is executed. I tried to see the output of the command doing a git pull >> OUTPUT, but it only creates an empty file.</p>
  
  <p>If I execute the git pull command by command line, or even if I execute the post-receive script manually from command line, I see the usual "Already up-to-date" info message.</p>
  
  <p>Am I doing something wrong? I really can't understand why <code>git pull</code> is the only command that fails in the script.</p>