Can't seem to discard changes in Git

后端 未结 20 1383
傲寒
傲寒 2020-11-29 21:17

After seeing the following from the command line:

# On branch RB_3.0.10
# Changed but not updated:
#   (use \"git add ...\" to update what will b         


        
20条回答
  •  猫巷女王i
    2020-11-29 21:42

    This has been bothering me for a while, almost every repo I'd check out had changes that I couldn't discard. Long story short, I tried all of the above, nothing worked. This is what I did to get things back to normal (on a Mac):

    Completely remove the autocrlf & safecrlf settings from ~/.gitconfig
    Completely remove the autocrlf & safecrlf settings from your repo's local config ./.git/config
    git rm --cached -r .
    git reset --hard
    

提交回复
热议问题