How to stop git from making files non-executable on cygwin?

GitPermissionsCygwin

Git Problem Overview


I use git on Windows via cygwin and soon decided to use filemode=false (since otherwise I've got a lot of changes after the initial git clone). I'm definitely not interested in tracking permission at all, the only think I need is for some files to be executable. From time to time, I find that the x flag on some files gets lost and I strongly suppose it's because of git.

I'd be happy with a solution allowing to execute chmod a+x ... when needed.

Git Solutions


Solution 1 - Git

I believe you want git update-index --chmod=+x <file>, followed by a commit.

Solution 2 - Git

You should start with git update-index --chmod=+x <file>.

But this does not change your working copy, for that:

git checkout .

Solution 3 - Git

I've met the same problem. git update-index --chomd=+x doesn't work for me.

I use chmod +x , then commit, it works perfect.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionmaaartinusView Question on Stackoverflow
Solution 1 - GitKarl BielefeldtView Answer on Stackoverflow
Solution 2 - GitAlexander PogrebnyakView Answer on Stackoverflow
Solution 3 - Gitthink2010View Answer on Stackoverflow