in Web & Tech

File Mode Isssues when Moving Git Repositories From Mac to Windows

Recently I had to copy an entire Git Repository from my MacBook to a Network Share that runs on Windows. Running git status on the new location notified me of file mode changes across all my files:

old mode 100644
new mode 100755

The solution for me was to change my repository’s git configuration to filemode = false.

To do so you simply have to edit .git/config and change that line from true to false.

To prevent Git from tracking file modes in future projects you can set your global config using git config --global core.filemode false or, for more recent versions of Git, git config --add --global core.filemode false.

Write a Comment

Comment

  • Related Content by Tag