warning: LF will be replaced by CRLF in package-lock.json. The file will have its original line e...

最近新开了一个项目,在提交时出现了如下提示:
warning: LF will be replaced by CRLF in package-lock.json.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in package.json.
The file will have its original line endings in your working directory

解决方法:

git config --global core.autocrlf true

问题:
将core.autocrlf设为false即可解决这个问题,不过如果你和你的伙伴只工作于Windows平台或者Linux平台,那么没问题,不过如果是存在跨平台的现象的话,还是需要考虑一下。
但当 core autocrlf为true时,还有一个需要慎重的地方,当你上传一个二进制文件,Git可能会将二进制文件误以为是文本文件,从而也会修改你的二进制文件,从而产生隐患

原文:https://blog.csdn.net/yuki_haha/article/details/79025083

你可能感兴趣的:(warning: LF will be replaced by CRLF in package-lock.json. The file will have its original line e...)