Git ignore file permission changes

Sometime you change the mode of files of your project.

Git chmod



sudo chmod -R 777 /var/www/project

But files are not modified in the repo. check the modified files in git status. so git show all these files are modified.

So you can remove these files from modified using this command.


git config core.fileMode false


   core.fileMode
       If false, the executable bit differences between the index and the
       working copy are ignored; useful on broken filesystems like FAT.
       See git-update-index(1). True by default.

git -c core.fileMode=false diff

And the --global flag will make it be the default behavior for the logged in user.

git config --global core.fileMode false

I hope this post will help you.

No comments:

Post a Comment

Download the eBook of react js for beginners

ReactJS basically is an open-source JavaScript library which is used for building user interfaces specifically for single page applications...

Popular