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]

There is a very similar question here: Git - post-receive hook with git pull "Failed to find a valid git directory".

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.


Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.