git status shows modifications even with autocrlf=false

后端 未结 6 1608
终归单人心
终归单人心 2020-11-30 03:21

I\'m experiencing the same issues as in this question: git status shows modifications, git checkout -- doesn't remove them

Git continues to show wor

6条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-30 03:34

    Although i don't know what is causing this weird behaviour, i know one more way of discarding changes that might work.

    Warning! Be extremely careful and do a backup first; this can be highly destructive.

    If all data that you care about is committed in the repository, you can simply delete everything in your working directory (of course except hidden .git directory) and run git reset --hard HEAD to have git recreate the working directory solely from the repository data.

    Remember to carefully check if you don't have any important data that is not tracked by git before doing this. It's not enough to check git status for uncommitted changes - remember that deleting all files from the working dir will also delete files which you told git to ignore, and they won't be recreated with git reset --hard HEAD because they're not tracked at all.

提交回复
热议问题