我在发出 git add .
命令时收到此错误
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in node_modules/babel- jscs/node_modules/babel-core/lib/transformation/file/plugin-manager.js.
最佳答案
这不是一个错误。这只是一个警告。
您可以阅读更多相关信息here .
autocrlf
的工作原理:
core.autocrlf=true: core.autocrlf=input: core.autocrlf=false:
repo repo repo
/ \ / \ / \
crlf->lf lf->crlf crlf->lf \ / \
/ \ / \ / \
此警告是什么意思
警告“LF将被CRLF替换”表示您(具有autocrlf
=true
)将在提交 checkout 周期后丢失unix风格的LF(它将被windows风格的CRLF替换)。 Git 不希望你在 Windows 下使用 unix 风格的 LF。
警告“CRLF将被LF替换”表示您(有autocrlf
=输入
)将在提交- checkout 周期后丢失Windows风格的CRLF(它将被unix风格的LF替换)。不要在windows下使用input
。
展示 autocrlf
工作原理的另一种方式
1) true: x -> LF -> CRLF
2) input: x -> LF -> LF
3) false: x -> x -> x
关于node.js - git 添加 . Node.js 的命令不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34656010/