Around 2014 I was working on a project using a Windows notebook, running a Debian VM that shared a directory so I could manage files via Sublime Text. Since the project was versioned with GIT, the files I created were always with a wrong set of permissions, e the files I changed, ended up with their permissions messed up.
To fix this problem, there is a GIT configuration that is called filemode, and if we turn it off, GIT won’t track changes in file permissions anymore. You can do that in a way that affects only your repository:
1 2 |
git config --unset core.filemode git config core.filemode false |
But you can also configure in a global way for GIT:
1 |
git config --global core.filemode false |
One last tip, in case you need to handle permissions e you’re running Windows, is to configure the execution part of the permissions, when working with shell files. For example:
1 |
git update-index --chmod=+x file.sh |
Reference: http://blog.lesc.se/2011/11/how-to-change-file-premissions-in-git.html