Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git CHMOD post-receive hook

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

like image 914
24creative Avatar asked Sep 27 '26 08:09

24creative


1 Answers

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
like image 106
Avi Avatar answered Sep 29 '26 20:09

Avi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!