git/list[1] front-page[2] threads[3] people[4] search[5] about
 

git merge changes file mode from 644 to 755

From
DODmitry Oksenchuk <oksenchuk89@gmail.com>
Date
Aug 14, 2015, 12:02 UTC
Message-ID
<CA+POfmsohJAGVYHM3nHJydoyxe92QFd59eWT_UG+_0fM46SATA@mail.gmail.com>
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.

Example with git merge: $ git reset --hard 9b90bac - the first branch $ git merge-base 9b90bac f41bd44 - the second branch e44b025b000fe71cf621b5aadad88e71d209e301 - the common ancestor $ git ls-tree 9b90bac stdafx.cpp 100644 blob 0bf386d4ae494503129921f5b5077a74976c8f91 stdafx.cpp - 644 in the first branch $ git ls-tree e44b025 stdafx.cpp - absent in the common ancestor $ git ls-tree f41bd44 stdafx.cpp - absent in the second branch $ git merge f41bd44 Auto-merging stdafx.cpp $ git ls-files -s stdafx.cpp 100755 0bf386d4ae494503129921f5b5077a74976c8f91 0 stdafx.cpp - 755 after merge

Example with git read-tree: $ git reset --hard 9b90bac $ git read-tree -m e44b025 9b90bac f41bd44 $ git ls-files -s stdafx.cpp 100644 0bf386d4ae494503129921f5b5077a74976c8f91 0 stdafx.cpp - 644 after read-tree -m

Why git merge changes mode from 644 to 755? Is it a known issue?
I use git version 1.9.5.msysgit.0. Maybe the issue was fixed in a later version?

Regards, Dmitry

Next: Johannes Sixt
Message 1 of 2 in “git merge changes file mode from 644 to 755”
  1. Dmitry OksenchukAug 14, 2015
  2. Johannes SixtAug 14, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.