You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When pulling that change you might end up in a situation where git tells you that you have modified files but git diff does not show any modifications. Even worse, git reset --hard will not get rid of those modifications either.
The reason is that the file only differs in its line endings, which however would be normalized away on commit, so the diff of the commit is empty. Git still considers the file modified though.
To fix this, you have to instruct git to remove the specific file from its cache first and then restore it. The command for this is
git rm --cached
To do this for the entire repo (all your uncommited changes will be lost!) you can do
git rm -r --cached .
Afterwards
git reset --hard
will restore a clean copy with the correct line endings for you.
I think this information belongs on a wikipage.
The text was updated successfully, but these errors were encountered:
In an email, @herhut-ggl said:
I think this information belongs on a wikipage.
The text was updated successfully, but these errors were encountered: