All Articles
Tutorialsgitwsl2linuxworkflow

Git is Marking Every File as Modified — Here's Why

19 August 2024· 2 min read· Andrew Arscott

Git is an excellent tool for managing your code, tracking changes, and collaborating — but sometimes it can go a little too far.

If you ever run git status and suddenly find every file in your codebase marked as modified, but you have not actually made any changes, it is probably because the file permissions have changed.

git status showing every file as modified

Now, generally speaking you should not be changing your file permissions en masse — certainly not in a production environment. But in development, if you have hit permission issues and at some point run sudo chmod -R 777 (particularly common if you develop using WSL2), you might find yourself in exactly this situation.

Git has a config option you can toggle to make it ignore executable file permission changes. Simply run:

git config core.fileMode false

Your git status and git diff will now only track files which have actually changed in content — not files that have simply had their permissions modified.

If you want to apply this globally across all your repositories rather than just the current one, add the --global flag:

git config --global core.fileMode false

Have thoughts on this? Get in touch.