How do I make Git ignore file mode (chmod) changes?

By | April 2, 2024
Spread the love

To make Git ignore file mode (chmod) changes, you can use the git config command to set the core.fileMode configuration option to false. This will make Git ignore changes to the file permissions (chmod) when determining if a file has been modified. Here’s how to do it:

git config core.fileMode false

You can run this command in your Git repository to set this configuration option locally. If you want to set it globally for all your Git repositories, you can add the --global flag:

git config --global core.fileMode false

After setting core.fileMode to false, Git will no longer track changes to file permissions, which means it won’t consider changes in file modes as modifications when determining if files have been changed.