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 选项为

原文地址:https://www.cnblogs.com/MrZhujl/p/13902581.html