1

I am using the following permissions to run my website (Magento/Php5.4)

find $path/. -type f -exec chmod 400 {} \;
find $path/. -type d -exec chmod 500 {} \; 
find $path/var/ -type f -exec chmod 600 {} \; 
find $path/media/ -type f -exec chmod 600 {} \;
find $path/var/ -type d -exec chmod 700 {} \; 
find $path/media/ -type d -exec chmod 700 {} \;

My files are running under the group www

These are the recommended setting for a Magento 1.9 site and it all works great. The problem I am having now is that when I try to merge a new branch in GIT I am getting the following

$ git merge origin/ticket-53
error: unable to create file app/code/local/Wage/Codebase/Block/Adminhtml/Client.php (Permission denied)
fatal: cannot create directory at 'app/code/local/Wage/Codebase/Block/Adminhtml/Client': Permission denied

I have my .git folder set to 777, I can do it as sudo but that is sort of pointless.

Do I need to add GIT to a different group, or maybe change the group that my files are running under?

brentwpeterson
  • 162
  • 2
  • 9

1 Answers1

0

I was able to get around this by setting my entire application to the following:

find . -type d -exec chmod 700 {} \;
find . -type f -exec chmod 600 {} \;

Which now seems obvious.

So on deployments we will set the folders to the above, the after the deployment we will set the permissions back to the original

After we deploy the code we switch back to these permissions

find . -type f -exec chmod 400 {} \;
find . -type d -exec chmod 500 {} \; 
find var/ -type f -exec chmod 600 {} \; 
find media/ -type f -exec chmod 600 {} \;
find var/ -type d -exec chmod 700 {} \; 
find media/ -type d -exec chmod 700 {} \;
chmod 700 includes
chmod 600 includes/config.php
brentwpeterson
  • 162
  • 2
  • 9