3

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

Zoe
  • 27,060
  • 21
  • 118
  • 148
24creative
  • 709
  • 2
  • 9
  • 14

1 Answers1

2

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
Avi
  • 19,934
  • 4
  • 57
  • 70
  • Thanks, i'm one step closer.. although chmod +x index.php sets the file on 775, I need 755. The weird thing is, when I chmod it to 755, git gives an error on stashing that it has no rights. – 24creative Nov 13 '11 at 15:54
  • Git doesn't store the full mode, just an executable bit. If it matters to you that it be 755 and not 775, you should set it in your deploy script (which it sounds like is part of your post-receive hook). – Avi Nov 13 '11 at 16:35