There have been recent discussions on the main Git list regarding the issue of 'round tripping' files from the object store to the file system and back again (inc smudge/clean filters, but that includes EOL), and how this can be affected by the many and various EOL (end of line) settings (including the .gitattributes).
In particular it was discussed how the different commands give a different view of the repository status. I would suspect (without any real knowledge) that Visual Studio may expect that the repository EOL is CRLF, while elsewhere there is an LF expectation, and despite the FS having CRLF, the viewpoints 'argue'. http://thread.gmane.org/gmane.comp.version-control.git/284980/match=eol+round+trip is part of the broader discussion. Philip ----- Original Message ----- From: Ben Page To: Git for human beings Sent: Sunday, March 13, 2016 1:41 AM Subject: [git-users] Re: Git says there are local changes, but there are no changes. (Windows) It appears none of the commenters understands how git reset works. Even if the problem is that Visual Studio messed up the git index, git reset should fix it. And if Visual Studio messed up the file (line endings or otherwise), the git reset --hard should revert it. This is certainly a bug in git for windows. On Tuesday, February 23, 2016 at 12:34:32 PM UTC-6, Ben Page wrote: I have a couple repos that routinely believe there are local changes, when there are none. The only solution seems to be to delete these files and reacquire them from git. For example: >git status On branch master Your branch is behind 'origin/master' by 2 commits, and can be fast-forwarded. (use "git pull" to update your local branch) Changes not staged for commit: (use "git add <file>..." to update what will be committed) (use "git checkout -- <file>..." to discard changes in working directory) modified: XXXXXXX modified: YYYYYYY no changes added to commit (use "git add" and/or "git commit -a") >git --version git version 2.7.2.windows.1 Reset doesn't work. >git reset --hard HEAD is now at cebdb13 Commit Message >git pull Updating cebdb13..076de5e error: Your local changes to the following files would be overwritten by merge: XXXXXXX YYYYYYY Please, commit your changes or stash them before you can merge. Aborting Checkout doesn't work >git checkout XXXXXXX >git checkout YYYYYYY >git pull Updating cebdb13..076de5e error: Your local changes to the following files would be overwritten by merge: XXXXXXX Please, commit your changes or stash them before you can merge. Aborting The only solution that I've found . >rm .git\index >rm XXXXXXX >rm YYYYYYY >git reset --hard >git pull Updating cebdb13..076de5e Fast-forward ... Can anyone help me understand why this is happening and how to avoid it? -- You received this message because you are subscribed to the Google Groups "Git for human beings" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "Git for human beings" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
