Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

The company I work for is using Git for deployment and because of this it overwrites specific permissions and ownerships. What is the best way to make sure that the folder ownerships and permissions are preserved when a git pull is conducted?

I do development on OS X, using MAMP, push to a staging server which is a clone of the environment on production. When it reaches Staging I have to correct the permissions afterward but they are usually set to 664 instead of 644, causing issues with suPHP.

share|improve this question
up vote 3 down vote accepted

Can you use one of the git hooks?

Probably the post-checkout hook.

share|improve this answer
Would that work with git-pull? – OpensaurusRex Mar 9 '12 at 20:19
This isn't an answer, it is another question. Not helpful. Don't know why it was accepted. If it does work, then this questionable answer should be updated with an actual answer. Pretty please. – geoidesic Dec 13 '14 at 11:39

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.