1

Whenever I clone a git repo, Windows changes the executable bit on my files. They are changed from 10755 to 10644. I can have git ignore this by setting filemode = false. However, when I commit and push my local branch to the remote branch, the executable bit for the file on the remote repo is also changed. This notifies the team that the file is no longer executable.

Example: File is no longer executable

Git says "mode change 10755 => 10644"

There are plenty of Windows users on the team without this issue, and I seem to be the only one with this issue. Any ideas how I can fix this so I'm not pushing mode changes when I push my local branch?

I'm using Windows 7 (64 bit). I have admin privileges and full control permissions for the workspace folder.

Kara
  • 6,115
  • 16
  • 50
  • 57
Eric
  • 2,008
  • 3
  • 18
  • 31
  • Which Git client are you using? Git for Windows? Cygwin? And which GUI is that you posted the screenshot from? – sschuberth Mar 14 '19 at 21:19

1 Answers1

1

As I mentioned here, if you must ad an executable (which is not the best practice), add it back to your repo with +x bit set.

That is possible with Git 2.9.1+

git add --chmod=+x -- yourFile

Then the commit should preserve the execution bit.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Thanks for the reply, do you know why this happens though? I'm surprised other Windows users on my team don't have this, but I do. I tried changing folder permissions and added the group 'Everyone' to have full control permissions (just as a test), but still couldn't get it to work. I do plan to leave it though as the files should not be executable in the first place. – Eric Dec 06 '16 at 23:40
  • @EricS Not sure: will the issue persists (on the remote repo) when you add with chmod,=+x and push? Do you have to add with chmod=+x the time after when you regenerate the binary? – VonC Dec 07 '16 at 05:18