简体   繁体   English

Git OS X 上的“文件名太长”错误

[英]Git 'filename too long' error on OS X

I have a directory that is tracked by git on linux and I copied it to mac OS.我有一个由git在 linux 上跟踪的目录,我将其复制到 mac OS。 On git status multiple files are untracked because of a filename: File name too long error.git status下,由于文件名未跟踪多个文件filename: File name too long错误。 One filename (with its relative path) is 393 characters.一个文件名(及其相对路径)为 393 个字符。 Isn't there a limit 4096 characters (except on Windows)?是否有 4096 个字符的限制(Windows 除外)? [Reference] My core.longpaths setting is set to true. [参考]我的core.longpaths设置为 true。 (Also so is core.precomposeunicode set to true, but probably irrelevant). (也将core.precomposeunicode设置为 true,但可能无关紧要)。 Any advice?有什么建议吗?

OS X has NAME_MAX (bytes in a path name component) set to 255: OS X的NAME_MAX (路径名组件中的字节)设置为255:

$ grep NAME_MAX /usr/include/sys/syslimits.h
#define NAME_MAX          255   /* max bytes in a file name */
#define CHARCLASS_NAME_MAX     14   /* max character class name size */

Is that 393 byte name a single component, or the entire path? 那个393字节的名称是单个组件还是整个路径? (Example: "foo/bar/baz" has 3 components that are each 3 bytes, and the entire path is 11 or 12 bytes depending on whether you count the terminating '\\0' . The NAME_MAX constant here does not count a terminating '\\0' .) (示例: "foo/bar/baz"具有3个分量,每个分量3个字节,整个路径为11或12个字节,具体取决于您是否对终止符'\\0'计数。此处的NAME_MAX常量不计算终止符'\\0' 。)

Other option is change symlink configuration for your project, and you don't need change system vars.其他选项是为您的项目更改符号链接配置,您不需要更改系统变量。

Use the console and use this commands:使用控制台并使用以下命令:

I take the answer from:我从中得到答案:

https://github.com/Urigo/IonicCLI-Meteor-WhatsApp/issues/4#issuecomment-382957742 https://github.com/Urigo/IonicCLI-Meteor-WhatsApp/issues/4#issuecomment-382957742

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

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