git不执行接收后钩子 [英] Git not executing post-receive hook

查看:65
本文介绍了git不执行接收后钩子的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的网站已移至新服务器,从ubuntu移至centos,并且git不再执行接收后挂钩。

My website was moved to a new server, ubuntu to centos and git is no longer executing the post-receive hook.

我尝试过更改权限,首先添加执行权限,然后将其设为777。

I've tried changing permissions, first adding execution permission and then making it 777.

我已经检查了挂载设置,以防它是 noexec (不是)。

I've checked mount settings in case it's noexec (it's not).

我在钩子上添加了一行touch testing.php。

I added a line touch testing.php to the hook. The file is not created after a push.

我可以使用 ./ post-receive 和它执行成功,包括制作测试文件。唯一的问题是错误:git checkout-index:无法读取/ file .. 的sha1文件,但是它更新了其余文件。我通过删除git目录并重新推送到远程来解决此错误。

I can manually run the hook with ./post-receive and it execute successfully, including making the test file. The only issue was error: git checkout-index: unable to read sha1 file of /file.., but it updated the rest of the files. I fixed this error by deleting the git directory and repushing to the remote.

问题似乎是git甚至没有尝试运行该钩子。

The problem seems to be git not even attempting to run the hook.

推荐答案

最终通过从git版本1.7.1升级到2.11来解决了这个问题

Ended up fixing this by upgrading from git version 1.7.1 to 2.11

这篇关于git不执行接收后钩子的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆