简体   繁体   English

文件名太长 Git in Windows 11错误

[英]File name is too long Git in Windows 11 error

I'm using Git-1.9.0-preview20140217 for Windows. As I know, this release should fix the issue with too long filenames.我正在为 Windows 使用Git-1.9.0-preview20140217 。据我所知,此版本应该解决文件名过长的问题。 But not for me.但不适合我。

Surely I'm doing something wrong, I did:当然我做错了什么,我做了:

git config core.longpaths true 
git add . 
git commit

Everything went well.一切顺利。 But when I now do a git status, I get a list of files with Filename too long, for example:但是当我现在执行 git 状态时,我得到一个文件名太长的文件列表,例如:

node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-handle-source-errors.js: Filename too long

It is quite simple to reproduce for me: just create a Yeoman web application with the Angular generator ( yo angular ) and remove node_modules from the .gitignore file.对我来说重现非常简单:只需使用 Angular 生成器 ( yo angular ) 创建一个 Yeoman web 应用程序,然后从.gitignore文件中删除node_modules Then repeat the aforementioned Git commands.然后重复上述 Git 命令。

What am I missing here?我在这里错过了什么?

The version of Git you're using is very old.您使用的 Git 版本很旧。 2.38.0 was just released, and the version you're using is a preview from 2014. It's almost certain that since that release, there have been substantial improvements to Git for Windows such that it handles long filenames better. 2.38.0 刚刚发布,您使用的版本是 2014 年的预览版。几乎可以肯定的是,自该版本以来,Git 对于 Windows 有了实质性的改进,因此它可以更好地处理长文件名。 It is known for certain that there have been security fixes since then.可以肯定的是,从那时起就进行了安全修复。

This feature is specific to Git for Windows, but I have at least seen patches from 2019 in the main tree that appear to involve it.此功能特定于 Git for Windows,但我至少在主树中看到了 2019 年的补丁似乎涉及它。 You're therefore better off upgrading to the latest version, and if this is still not working for you, file an issue on the Git for Windows issue tracker if one is not already present.因此,您最好升级到最新版本,如果这仍然不适合您,请在 Git 上提交问题以获取 Windows 问题跟踪器(如果尚不存在)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM