By default. git tracks changes in file permissions of files & folders present in your repository. So if any file permission changes, git will show it as file modification. It is a good feature to ensure that your repository’s file permissions are not changed by another script or application. But sometimes you may need to disable tracking file permission changes. In this article, we will learn how to ignore git file permission changes.
How to Ignore Git File Permission Changes
It is very easy to configure git to ignore file permission changes.
$ git config core.fileMode false
The above command will ignore file permission changes for current project. If you want to set it for all projects on your system, run the following command instead.
$ git config --global core.fileMode false
If you want to re-enable git file permission changes, just set the above variable to true.
$ git config core.fileMode true $ git config --global core.fileMode true
In this article, we have learnt how to ignore file permission changes in git.
How to Configure Line Endings in Git Commit
Git Remove File from History
Bash Loop Through Files in Directory Recursively
How to Remove .pyc Files from Git Repository
How to Reset Local Git Repository to Remote