How To Ignore Mode Changes In Git

25th June 2012 - 2 minutes read time

Git will track changes to files and directories, including any changes to permissions done via chmod. In most development environments I tend to have a different set of permissions to those on the live site so I am usually not interested in tracking permissions changes. To prevent git from looking at the difference between the permissions of a file you need to set the core.filemode configuration option to false.

git config core.filemode false

Here is the entry from the git-config(1) manual page.

  1. core.fileMode
  2. If false, the executable bit differences between the index and the working tree are ignored; useful on broken
  3. filesystems like FAT. See git-update-index(1).
  5. The default is true, except git-clone(1) or git-init(1) will probe and set core.fileMode false if appropriate
  6. when the repository is created.

This information was originally taken from this post on Stackoverflow. I am always forgetting how to do this, so as an aid to memory I am writing this post.

Add new comment

The content of this field is kept private and will not be shown publicly.