Git Reference ยท Configuration Options
core.fileMode setting
Reference for core.fileMode: whether Git notices changes to the executable permission bit, why it is false on some file systems, and how to fix mode noise.
Git stores one permission detail for each file: whether it is executable. Blobs are recorded with mode 100644 (regular) or 100755 (executable), plus 120000 for symlinks. core.fileMode controls whether Git compares the executable bit on disk with the one in the index.
When it is true (the default on Linux and macOS), chmod +x shows up as a change. When it is false, Git assumes the file system cannot be trusted with permissions and ignores the bit in the working tree. git init and git clone probe the file system and set the value for you, which is why a repository on a Windows drive or a mounted FAT disk often contains filemode = false.
git config core.fileMode false # ignore executable-bit changes in this repository git update-index --chmod=+x script.sh # still record the bit explicitly
Try it
Press Run (or Ctrl + Enter) to see the result here.
Program input ยท what you'd type while the program runs
Type the answers before you press Run, one per line. Each time the program reads a line (with read or cat), it gets the next line from this box.
Press Run (or Ctrl + Enter) to see the result here.
Program input ยท what you'd type while the program runs
Type the answers before you press Run, one per line. Each time the program reads a line (with read or cat), it gets the next line from this box.
Syntax
git config core.fileMode <bool>
| Value | Effect |
|---|---|
true |
The executable bit of working tree files is compared with the index and reported as a mode change. |
false |
The bit on disk is ignored. New files are added as 100644 unless you use git update-index --chmod. |
Edge cases: only the owner-executable bit matters. Git never stores other permission bits, owners or timestamps. Directories are not recorded.
Usage notes
- Symptom of a wrong setting:
git difflists every file with "old mode 100644 / new mode 100755" after a checkout from another system, orgit statusshows modified files with an empty content diff. - Fix for noise: set
core.fileMode falsefor this repository. Do it per repository, since a globalfalsehides real permission changes everywhere. - Fix a missing bit properly:
git update-index --chmod=+x pathrecords it in the index; commit it so everyone gets executable scripts. - WSL and Docker bind mounts often present everything as
755or777; this is the usual cause of the mode noise. git diff -Gandgit applycan both be told to ignore modes, but the config is the reliable solution.core.symlinksis the sibling setting for file systems without symlink support: whenfalse, links are checked out as small text files.git add --chmod=+xsets the bit while staging a new file.