Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a system setup like this:

However no matter how I configure the shell environment (i.e. GIT_DIR and PWD) the git-pull command does NOT run when called by the hook. Literally there is NO output whatsoever.

My post-update looks like:

/git/Lunch.git/lunch-receive > lunch.txt

and my lunch-receive script looks like:

service myService stop
cd /usr/lunch
unset GIT_DIR
git reset --hard # necessary or the pull fails
git pull hub master # this line DOESN'T RUN grrrrr!
chmod u+x *.sh
chmod -R u+x bin
service myService start

Finally, lunch.txt (the output) looks like

HEAD is now at 5956c0b [old commit message]
share|improve this question

There is a very similar question here:

The long and short of it is, you'll need to unset GIT_WORK_TREE; or to make sure it really takes, pass in the --git-dir and --work-tree parameters to your git pull.


share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.