Search code examples
windowsgitbootcamp

How can I prevent file mode changes when working with a Git working directory on a shared drive under Bootcamp?


I use Windows under VMWare Fusion to do my Windows based dev work. I keep my code on the OS X partition and share the folder so Windows sees it as a drive. I can then use Git in my shell like I do with everything else.

However, whenever I change a file under Windows, the mode changes from 100644 to 100755 (chmod +x essentially, so Windows appears to be doing something which causes Git to think the executable bit has been set.

How can I stop it? .gitconfig under Windows isn't relevant, Windows doesn't even have Git installed, and under OS X it doesn't seem likely either, but...

[EDIT]

After some thought, I've turned core.filemode to off in the local .git/config for the working dir in question, thus "solving" the problem in one way. However, it's not a great solution, as I'd like to be able to change file permissions/exec in OS X, but not have Windows editing change things. I'm beginning to think that might just not be possible as the setting can only ever be at working dir level.


Solution

  • Set core.fileMode=false to prevent git from noticing changes to the permissions. You can then see the executable bit manually using:

    git update-index --chmod=+x