git pull in a hook not executing
I have a system setup like this:
http://joemaller.com/990/a-web-focused-git-workflow/
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:
#!/bin/sh
/git/Lunch.git/lunch-receive > lunch.txt
and my lunch-receive script looks like:
#!/bin/sh
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]
Absurdly, changing
/git/Lunch.git/lunch-receive > lunch.txt
to:
/git/Lunch.git/lunch-receive > lunch.txt 2>&1
and
git pull hub master
to:
echo before-pull
git pull --verbose hub master || echo "git-pull: returned error code"
echo after-pull
seemed to have fixed the problem
精彩评论