This can be a real pain. You are working on git repo to which many developers with different OS (and with different line endings) contribute.
So, you have such a repo and at some time you may notice that some files which are marked as if they had been modified. You try to git checkout, reset, clean, but nothing helps…
It happens because of the wrong interpretation of line ending characters. This case is described here and here.
But actually the command suggested there did not help in my last case (and I lost more than two hours). Eventually, the following command solved the issue:
git config core.filemode false