node.js - 由于文件名太长,Git Extensions 正在崩溃。我该如何解决这个问题?

标签 node.js git npm git-extensions

我收到来自 git 的以下警告,导致 Git Extensions 在我查看当前修改的文件时崩溃:

warning: unable to access 'mysolution.mobile/node_modules/gulp/node_modules/gulp-util/node_modules/dateformat/node_modules/meow/node_modules/normalize-package-data/node_modules/validate-npm-package-license/node_modules/spdx-correct/node_modules/spdx-license-ids/.gitignore': Filename too long

在命令行中查看 git status 时可以看到警告

我考虑过将 Windows 资源管理器导航到该目录,但是当我这样做时,那里没有 .gitignore 文件。

文件夹中仅有的文件是

LICENSE
package.json
README.md
spdx-license-ids.json

我该怎么办?

我并不特别关心将 Node 内容提交到我的存储库,因此我可以将此位置添加到另一个 .gitignore。但是,我读到最好提交 Node 内容。

编辑

有趣的是,当我尝试使用命令行执行以下操作时:

git add mysolution.mobile/node_modules/gulp/node_modules/gulp-util/node_modules/dateformat/node_modules/meow/node_modules/normalize-package-data/node_modules/validate-npm-package-license/node_modules/spdx-correct/node_modules/spdx-license-ids/.gitignore

它返回以下错误:

fatal: pathspec 'mysolution.mobile/node_modules/gulp/node_modules/gulp-util/node_modules/dateformat/node_modules/meow/node_modules/normalize-package-data/node_modules/validate-npm-package-license/node_modules/spdx-correct/node_modules/spdx-license-ids/.gitignore' did not match any files

did not match any files

为什么找不到它就声称是未暂存的文件?

最佳答案

此命令应在您的 git 目录中运行。

git config --system core.longpaths true

或者,您可以在 git 配置文件中更改此选项。

关于node.js - 由于文件名太长,Git Extensions 正在崩溃。我该如何解决这个问题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37021748/

相关文章:

node.js - "Application has thrown an uncaught exception and is terminated: Error: listen EACCES 0.0.0.0:80"

git - 删除所有已经被压扁 merge 的本地分支

git - 理论上可以在浏览器扩展中捆绑 Mercurial 或 Git 吗?

node.js - 在 WebStorm 和 npm 中调试

javascript - Node : Return array of arrays from dialog openDirectory

javascript - Model.remove() 根本不起作用

Git:如何为 merge 创建补丁?

npm - 有没有办法让 `npm pack` 递归地包含所有依赖包而不仅仅是基础包?为什么要这样做?

javascript - 在脚本之间传递参数?

javascript - 使分页与其计数一起工作