git如何避免”warning: LF will be replaced by CRLF“提示?

遇到一个Git 警告:

warning: LF will be replaced by CRLF in debug.log.
The file will have its original line endings in your working directory

解决:

  1 设置core.autocrlf=false,windows也用LF换行。
     git config --global core.autocrlf false 
     2.1 设置一个.editorconfig 来保证文件都是 LF 结尾。
  除了记事本,其他编辑器都可以正常编辑

  2.2 或者在编辑器中修改

  如VSCode,在settings中设置file:eol 选项为\n

 

posted @ 2020-10-30 15:55  真的想不出来  阅读(223)  评论(0编辑  收藏  举报