3

Why does git for Cygwin always get confused with file permissions? The file didn't change. TortoiseGIT doesn't think it is modified. DOS Git doesn't think it's modified.

$ git diff README.md
diff --git a/README.md b/README.md
old mode 100644
new mode 100755

$ ls -l README.md
-rwx------+ 1 Chloe None 824 Sep  4 00:55 README.md

$ which git
/usr/bin/git

$ git --version
git version 1.8.3.4

$ uname -a
CYGWIN_NT-6.2-WOW64 xps 1.7.25(0.270/5/3) 2013-08-31 20:39 i686 Cygwin
  • What git version does git cygwin uses? A similar question (on DOS, not cygwin) mentioned that a more recent client deals with permissions more consistently: stackoverflow.com/a/18842322/6309 – VonC Sep 19 '13 at 6:23
  • @VonC Of course... added. – Chloe Sep 19 '13 at 14:42
  • 1
    That seems recent enough ;) No clue for now, though. – VonC Sep 19 '13 at 15:03
2

It looks like the README.md in your working directory has user execute permissions set, but not so in the index, hence the reported difference.

Try this and see if it helps:

git config core.filemode false

For example, I recreated something that looks like your situation, and here's what I get (with both settings of core.filemode):

$ git config core.filemode true

$ git diff foo.txt
diff --git a/foo.txt b/foo.txt
old mode 100644
new mode 100755

$ ls -l foo.txt
-rwx------+ 1 david Domain Users 0 Jul  2 12:40 foo.txt*

$ git config core.filemode false

$ git diff foo.txt

$

Warning, I'm using different versions of Cygwin and Git:

$ which git; git --version; uname -a
/usr/bin/git
git version 1.7.9
CYGWIN_NT-6.1-WOW64 XXXXXX 1.7.30(0.272/5/3) 2014-05-23 10:36 i686 Cygwin

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.