问题
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