node.js - git 添加 . Node.js 的命令不起作用

标签 node.js git bitbucket

我在发出 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/

相关文章:

node.js - 错误: Cannot read property '_id' of undefined

macos - OS X 上的 Bitbucket 权限被拒绝(公钥)Git

javascript - 如何通过 yarn 安装可编辑依赖项

git - 推送失败后重新推送提交

git - 如何抑制 "Changes not staged for commit"?

git - 如何使用 Github Actions 查看最新提交?

ubuntu - 从 BitBucket 下载 - 授权失败

configuration - 是否可以针对bitbucket管道中不同的更改文件触发不同的任务?

node.js - 可怕的node.js错误

node.js - 通过 Node.js 与 ACR1252U NFC 读卡器对话