繁体   English   中英

Git接收后未运行

[英]Git post-receive Not running

我在这里搜索了几个问题,但仍未获得答案,因此我将询问我的具体情况。

真正简单的接收后钩子,它只是卷曲到Redmine上,以迫使Redmine在提交时更新存储库的视图。 (为了进行调试,我还回显了“ Post Receive Hook Go”以查看

设置:裸仓库/git/repos/test.git

$ cd ~/
$ git clone file:///git/repos/test.git
$ cd test/
$ vim somefile_gets_updated
$ git commit -a -m 'Tackling bug #1, include the bug number so Redmine will pick it up and associate it'
$ git push origin master

这将按预期方式提交和推送,但是后接收挂钩不会触发

如果我做$ curl http://localhost:3000/sys/fetch_changesets?key=cGdcUaRr8u4Rr4zXzXhr并刷新我的redmine问题页面,那就好了!

如果在推送之后我这样做:

$ ./.git/hooks/post-receive

我得到:

$ Post Receive Hook Go

可行,万岁!

所以我知道卷发有效,即使是后期接收有效,Git也不会触发

这是钩子

 $ cd .git/hooks
 $ ls -l | grep post-receive
 $ -rwxr-xr-x  1 bobbydown  staff   109 Dec 22 03:42 post-receive

我只是不明白为什么git没有运行钩子...

回购接收到推送的提交后,将触发后接收挂钩。

在您的方案中,挂钩应该位于仓库中,而不是克隆中。

暂无
暂无

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

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