0

I have been struggling with this git problem.

The problem is that when I do a fresh clone from GitHub, git reports that some files has changed although I have not touched them.

Often this happens when I switch branches as well. If I go from an unmodified master to another branch and back to master, it says files has been changed in master.

I have been reading about line endings and tried just about everything in that category, but nothing seems to help.

The repository is https://github.com/seesharper/LightInject is case someone would like to try and see if they have the same problem.

A friend of mine had the exact same problem with the same repository on his Windows 8 machine. Then he tried it on Windows 7 and the problem went away.

Does anybody know of any issues with using git on windows 8.

I have also tried this on another Windows 8 machine and it has the same problem.

seesharper
  • 3,249
  • 1
  • 19
  • 23
  • Does this problem apply to You: http://stackoverflow.com/questions/17562439/git-repo-keeps-showing-modified-files ? (Uppercase and lowercase files existing in GIT index and case ignorant operating system) – Kamiccolo Nov 08 '13 at 11:39
  • I don't think so. When I do a grep for one of those modified files, I get only one hit. Not one in lowercase and one in uppercase as seems to be the problem in the link you posted. The strange thing is that it seems to work just fine on Windows 7. – seesharper Nov 08 '13 at 12:07

2 Answers2

0

I experienced the same issue with Windows 7. This is something I did to resolve (you might try):

git clone git@github.com:seesharper/LightInject.git
cd LightInject
git status
git checkout -f -b mine HEAD~
git status
git checkout master
git status
git branch -D mine
cforbish
  • 8,567
  • 3
  • 28
  • 32
  • That seems to work, but if I checkout the Next branch and back to master, I'm back to git telling me there are modified files in master. I just got a report that this is also the case on Window 7. Any thoughts? – seesharper Nov 08 '13 at 12:19
0

I've dealt with this issue in the past - keep in mind that most git installations run on non-windows servers. There's a distinct possibility that what Windows is seeing is actually something where the "filemode" of the file is different than what Linux expects, therefore it sees the file as changed.

Poking around on the internet, there may be a way to fix the filemode issue - but nothing on google is jogging my memory at the moment. I skimmed over this, maybe something in it will help?

https://groups.google.com/a/chromium.org/forum/#!topic/chromium-dev/0EdNev3NNsw

I can't promise the above has a silver bullet for you, but it seems like there's good discussion about how Windows filemode messes up git indexes, sometimes.

Jason Lowenthal
  • 790
  • 1
  • 5
  • 16
  • I have gotten around the problem for now. As it turned out it seemed that the master branch was the trouble maker. I had to delete the branch (locally and remote) and create a new master branch from my development branch. The problem went away. Since the line endings did not affect this at all, I find it very plausible that what you mentioned here is the cause of the problem. Thanks – seesharper Nov 09 '13 at 11:15
  • Glad you got it worked out. Sometimes file mode, white space, and line ending conflicts between Windows and non-Windows machines gets irritating. – Jason Lowenthal Nov 09 '13 at 16:32