Git CHMOD后接收钩 [英] Git CHMOD post-receive hook

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

问题描述

我在我的web服务器上使用了一个裸露的远程存储库,并附带一个post-receive挂钩,它会自动将我的文件推送到public_html目录中。


$ b 问题是,我正在使用codeigniter,index.php文件必须是chmod 755.我用filezilla在服务器上更改了它,但是在每次推送之后,index.php文件被设置为644,这会导致内部服务器错误。



即使index.php没有被更改或隐藏,也会发生这种情况。



我搜索了一个解决方案,但迄今没有运气..有人可以帮助我呢?
我使用Tower GIT客户端进行提交/推送。



谢谢

解决方案

Git将一个可执行位与每个文件一起存储在存储库中。如果它认为该文件的模式为644,那么您可能需要更改存储库本身的权限,方法是将它们设置为您的工作副本,提交和推送:

  chmod + x index.php 
git add index.php
git commit


I'm using a bare remote repository on my webserver with a post-receive hook that will automatically push my files in the public_html directory.

The problem is, I'm using codeigniter and the index.php file has to be chmod 755. I changed it on the server with filezilla, but after every push the index.php file gets set to 644, which results in an internal server error.

This happens even when the index.php isn't changed or stashed..

I've searched for a solution, but so far without luck.. Could someone help me with this? I'm using the Tower GIT client to commit/push by the way.

Thanks

解决方案

Git stores an executable bit along with each file in the repository. If it thinks the file has mode 644, then you probably need to change the permissions in the repository itself, by setting them in your working copy, committing, and pushing:

chmod +x index.php
git add index.php
git commit

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

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