Git recognize "unchanged" files as changed, why?

306 views Asked by At

I have the same GIT repository cloned in Windows and Linux. Sometimes I switch from Windows to Linux and everything goes fine and this mean unchanged files remain unchanged. Now I have switch back to Windows from Linux, I pull all my work and run a composer update which didn't modify any tracked files. I must say the same command from Linux doesn't mark the files as changed.

How do I know? Because the content is exactly the same (see the images below).

this is a file comparison using PhpStorm IDE

this is a file comparison using Smargit

As you can see in both pics and using different applications the file remains the same however Git is tracking them as changed. Then I remember this useful post How do I make Git ignore file mode (chmod) changes? and after read it back and forth I went to the repository config file .git/config and surprise the value was already there:

[core]
    repositoryformatversion = 0
    filemode = false
    bare = false
    logallrefupdates = true
    symlinks = false
    ignorecase = true

So I am completely lost and don't know what to do to avoid such behavior. Can any give me some ideas? Any clue?

0

There are 0 answers