Make Git “LF will be replaced by CRLF” warnings go away

前端 未结 6 1158
旧时难觅i
旧时难觅i 2020-12-07 14:06

I have setup Git so it doesn\'t commit inconsistent line endings. The problem with that is a whole pile of files appear modified even though they are not. What do I type to

6条回答
  •  情深已故
    2020-12-07 14:44

    Try this, it worked for me:

    cd src/au/policy/dao
    dos2unix
    

    If there are other files in that folder, then you'll want to break it up into the following (otherwise it will try to do it on every file in any subdirectories, which may take a while):

    cd src/au/policy/dao
    dos2unix EmailQueue.java
    dos2unix EmailQueueFactory.java
    dos2unix PolicyPublisher.java
    

    It ran really quick on my machine and fixed all of the line endings, and it's a little simpler and easier than some of these other fixes.

提交回复
热议问题