我有这样的系统设置:
http://joemaller.com/990/a-web-focused-git-workflow/
但是无论我如何配置shell环境(即GIT_DIR和PWD),git-pull命令都不会在挂钩调用时运行。从字面上看,没有任何输出。
我的更新后的内容如下:
#!/bin/sh
/git/Lunch.git/lunch-receive > lunch.txt
我的午餐接收脚本如下:
#!/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
最后,lunch.txt(输出)看起来像
HEAD is now at 5956c0b [old commit message]
答案 0 :(得分:1)
荒谬地,改变
/git/Lunch.git/lunch-receive > lunch.txt
为:
/git/Lunch.git/lunch-receive > lunch.txt 2>&1
和
git pull hub master
为:
echo before-pull
git pull --verbose hub master || echo "git-pull: returned error code"
echo after-pull
似乎解决了这个问题