root@DESKTOP-Q3N0JNG:/mnt/d/wwwroot/red-tomato-business/serve# git add .
warning: CRLF will be replaced by LF in serve/app/jobs/apis/sys_job.go.
The file will have its original line endings in your working directory
warning: CRLF will be replaced by LF in serve/app/jobs/examples.go.
The file will have its original line endings in your working directory
warning: CRLF will be replaced by LF in serve/app/jobs/models/sys_job.go.
The file will have its original line endings in your working directory
warning: CRLF will be replaced by LF in serve/app/jobs/service/dto/sys_job.go.
首先可以先依据大佬的写法
解决方式:
可以查看git配置
git config -l
情况一:
Git 可以在你提交时自动地把回车(CR)和换行(LF)转换成换行(LF),而在检出代码时把换行(LF)转换成回车(CR)和换行(LF)。 你可以用git config --global core.autocrlf true
来打开此项功能。 如果是在 Windows 系统上,把它设置成 true,这样在检出代码时,换行会被转换成回车和换行:
#提交时转换为LF,检出时转换为CRLF
$ git config