Eclipse and Windows newlines

前端 未结 6 2159
天命终不由人
天命终不由人 2020-11-29 15:43

I had to move my Eclipse workspace from Linux to Windows when my desktop crashed. A week later I copy it back to Linux, code happily, commit to CVS. And alas, windows newlin

6条回答
  •  独厮守ぢ
    2020-11-29 16:17

    In addition to the Eclipse solutions and the tool mentioned in another answer, consider flip. It can 'flip' either way between normal and Windows linebreaks, and does nice things like preserve the file's timestamp and other stats.

    You can use it like this to solve your problem:

    find . -type f -not -path './.git/*' -exec flip -u {} \;
    

    (I put in a clause to ignore your .git directory, in case you use git, but since flip ignores binary files by default, you mightn't need this.)

提交回复
热议问题