Git file permissions on Windows Git file permissions on Windows windows windows

Git file permissions on Windows


I found the solution of how to change permissions (also) on Windows here: http://blog.lesc.se/2011/11/how-to-change-file-premissions-in-git.html

For example following command adds user execute permission to an arbitrary file:

git update-index --chmod=+x <file>


From another question here on stackoverflow: How do I make Git ignore file mode (chmod) changes?

Try:

git config core.filemode false

From git-config(1):

   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.


Handy one-liner for Git Bash:

find . -name '*.sh' | xargs git update-index --chmod=+x

It will mark all .sh file as executable.After that, you just have to git commit.