Updating the Git index failed, LF will be replaced by CRLF?

前端 未结 4 1218
别跟我提以往
别跟我提以往 2021-02-15 17:19

I\'m using git-gui for version control and pushing them to remote locations. When I tried to Rescan files for changes, I got this message and I\'m not sure what that means. Plea

4条回答
  •  不思量自难忘°
    2021-02-15 17:57

    The solution is to accept that behaviour. You're on Windows so you should have autocrlf as true. It's there so line-endings in Git's internal records are consistent. The warnings are there so you can see if you're about to accidentally corrupt binary files during a commit.

    Click Continue. If you want to prevent it happening on those files again, you need to unstage those files, then correct the line-endings and stage them again. Do so by changing the line-endings of the file to CRLF/Windows in your editor, or drop these command line tools into your system32 directory so you can do unix2dos some_file.java on such files at any command prompt.

提交回复
热议问题