Subject: Re: git merge changes file mode from 644 to 755

From: Johannes Sixt <[email-masked]>
Date: Fri, 14 Aug 2015 16:17:53 +0200

Am 14.08.2015 um 14:02 schrieb Dmitry Oksenchuk:
> Hello,
>
> I've noticed strange behavior of git merge on Windows with
> core.filemode=false (set by default). Git changed mode of some files
> from 644 to 755 for unknown reason. One of the files is stdafx.cpp,
> it's absent in the common ancestor, it was added in the first branch
> (master) with mode 644 and it's still absent in the second branch
> (feature). So, git merges the file without conflicts but changes mode
> from 644 to 755.

I do know the git-merge-recursive does not honor core.filemode. However, 
I am surprised to see a mode change from 644 to 755. I usually observe 
only mode changes from 755 to 644, but then the case where the file is 
not present on one branch is uncommon for me.

> Why git merge changes mode from 644 to 755? Is it a known issue?

So, well, yes, it is known that with git merge mode changes do occur, 
but no, 644 to 755 is news to me.

The work-around is to unstage the file and stage it again, e.g. with 
git-gui and then to amend the merge commit.

-- Hannes