Git CHMOD post-receive hook

為{幸葍}努か 提交于 2019-12-11 06:20:55

问题


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


回答1:


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


来源:https://stackoverflow.com/questions/8111804/git-chmod-post-receive-hook

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!