方法一:一个文件一个文件的改

方法二:全局配置
1. 设置 eol 为 \n

2.git 在维护版本库的时候统一使用的是 LF
这样就可以保证文件跨平台的时候保持一致。
在 Linux 下默认的换行符是 LF。
在 Windows 下默认的换行符是 CRLF,需要保证在文件提交到版本库的时候文件的换行符是 LF。
在命令行窗口中运行正面命令:
git config --global core.autocrlf false
3.vscode CRLF 自动转 LF
(1). 安装 EditorConfig for VS Code 插件
(2). 新建 .editorconfig ,放在项目根路径下,内容如下:
# editorconfig.orgroot = true[*]indent_style = spaceindent_size = 2end_of_line = lfcharset = utf-8trim_trailing_whitespace = trueinsert_final_newline = true[*.md]trim_trailing_whitespace = false
具体:
