From: Martin Date: Sun, 25 Jul 2021 15:04:08 GMT Subject: Files modified, even after: git reset --hard Message-ID: I have some files, that will show up modified. Always. If I just switch to a commit, with clean worktree before, then those files will be modified. I can not stash them. git reset --hard does not change anything. Diff shows the entire file is modified. I suspect its the line endings.. This happens on windows, and   autocrlf=true The checked out file (which is marked as modified) has the correct CrLf endings. What I have not been able to find, is what line endings are stored in the blob. Its an xml file, so they should be just Lf. But I *suspect* that the blob contains either CrLf, or mixed line-endings. Could that be? that if a file does have unexpected line endings in the commit's blob, that it shows as modified? One the one hand, yes, If I commit, that file will change. On the other hand, if I just check out (or do reset-hard) then I don't expect modified files.... So what should happen? This also causes problems, because in order to for example rebase something, I first need to switch to some commit that can be checked out without modified files. Or rebase will not work. Also in that repro, I had problems that some rebases failed with (with and without --reapply-cherry-picks)    error: add_cacheinfo failed Those rebase where between an orphaned branch, and a "normal" branch. And it is possible that the file only had the line ending issues in one of the 2 branches.... But that I was not able to further investigate. //git for windows git version 2.32.0.windows.2