Here is some pertinent output from the command line (with poshgit showing the status):
[Branch1]> git checkout Branch2
Switched to branch 'Branch2'
[Branch2 +0 ~3 -0]>
[Branch2 +0 ~3 -0]> git diff --ignore-space-at-eol
[Branch2 +0 ~3 -0]> git checkout .
[Branch2 +0 ~3 -0]>
I tried the solutions suggested in this question
[Branch2 +0 ~3 -0]> git reset --hard
HEAD is now at c8be749 some comment
[Branch2 +0 ~3 -0]> git reset HEAD
Unstaged another commit:
M Src/somefile
M Src/someotherfile.cs
M Src/athirdfile.cs
[Branch2 +0 ~3 -0]>
how does this happen and how can I fix it apart from committing the changes as I seem unable to undo the differences. Even stashing does nothing.
Some suggestions for how we got into this mess and how we can get out of it would be much appreciated.
I have been able to reproduce this reliably now so am in a position to get a more definitive answer. If I freshly clone me repo, then switch to a branch and then back to master I get some files which say they have changes. I have tried playing with the settings of core.autocrlf but that just seems to change the number of files that are affected and doesn't solve the problem completely.
What can I do to try and fix this increasingly annoying issue?