Git: How to revert 2 files that are stubbornly stuck at “Changed but not committed”?

后端 未结 12 765
北海茫月
北海茫月 2020-12-22 19:15

I have a repo that has two files that supposedly I changed locally.

So I\'m stuck with this:

$ git status
# On branch master
# Changed but not update         


        
12条回答
  •  长情又很酷
    2020-12-22 19:36

    What are the line endings in the files? I'm betting they're CRLF. If they are, check out this guide: http://help.github.com/line-endings/

    In short, you need to make sure git is set to convert the line endings to LF on commit, and then commit those files. Files in the repo should always be LF, files checked out should be the OS's native, assuming you set git correctly.

提交回复
热议问题