3

If you have a file added to a Git repository and you change the execution permission (e.g. chmod 0755 file), Git tells that file has changed.

This can be useful, but sometimes is a pain in the neck when you are working on a web application and server permissions differs from you computer permissions.

Does anyone know why Git behaves like this? Is there a security/performance/any other reason to do that?

1 Answer 1

6

You can

git config core.filemode false

to turn this feature off.

The idea of keeping track of the x bit is to make life easier for people cloning the repository as it might contain some scripts (like configure) that need to be executable for building the project.

Instead of just whole-sale turning it off, why not fixing the mode once and then keeping it the same?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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