繁体   English   中英

git拉入钩子不执行

[英]git pull in a hook not executing

我有这样的系统设置:

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]

荒谬地,不断变化

/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

似乎已经解决了问题

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM