LF will be replaced by CRLF in package.json.

问题场景:

代码完成,vscode终端中执行【git add .】准备提交代码,出现如标题警告,截图如下:

解决办法:

在工程目录下添加 .gitattributes 文件,文件内容为: 

package.json text eol=lf

package-lock.json text eol=lf

1 #在工程目录下添加 .gitattributes 文件,文件内容为:
2  
3 package.json text eol=lf
4 package-lock.json text eol=lf

囫囵吞枣,不知所以,望大佬赐教!

原文地址:https://www.cnblogs.com/fxwoniu/p/14785071.html