I have been came across this problem over and over again. I have a git repository set up on my remote server and all the files are set to 644 and folders are set to 755. However, every time after i pulling from git repository(i'm using bitbucket), i noticed the permission of the file which i modified was changed into 664 which results a Internal server Error. For example, I changed the index.php, and it occurs 500 when i tried to get access to it
i have to use
find . -type d -print0 | xargs -0 chmod 0755
and find . -type f -print0 | xargs -0 chmod 0644
to manually changed my files permission back to normal
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…