Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

git克隆或推送仓库时长路径报错的解决方法 #43

Closed
dyphire opened this issue May 12, 2023 · 6 comments
Closed

git克隆或推送仓库时长路径报错的解决方法 #43

dyphire opened this issue May 12, 2023 · 6 comments

Comments

@dyphire
Copy link
Collaborator

dyphire commented May 12, 2023

由于操作系统对于长路径的字符限制会导致在git克隆或推送仓库时出现报错无法继续执行的问题,可以通过以下命令来解除git的长路径的限制:

git config --global core.longpaths true

Windows上还需要进一步执行以下命令:

git config --global core.protectNTFS false
@sommio
Copy link
Contributor

sommio commented May 12, 2023

这个方法仅适用于 Windows,它是 MSYS 的限制
对于 Linux 来说,它是内核硬编码的,ext 系列文件系统无法修改,btrfs/zfs 可以更改相关 define 重编译

此外 MSYS 的限制比 Linux 限制更宽松,#12#15 都是 Linux 导致的,而非 MSYS

@dyphire
Copy link
Collaborator Author

dyphire commented May 12, 2023

原来Linux上还存在硬编码的字符限制,不通用的解决方法就没有意义了,感谢告知

@dyphire dyphire closed this as not planned Won't fix, can't repro, duplicate, stale May 12, 2023
@foxofice
Copy link
Owner

原来Linux上还存在硬编码的字符限制,不通用的解决方法就没有意义了,感谢告知

之前有两个提交,暂时删除了过长的目录,一个是白箱、一个是寒蝉,你那边把目录修改得短一点再重新添加一下。比如vcb的就总是很长,一般直接写成“vcb”大家也能看懂。

@dyphire
Copy link
Collaborator Author

dyphire commented May 12, 2023

原来Linux上还存在硬编码的字符限制,不通用的解决方法就没有意义了,感谢告知

之前有两个提交,暂时删除了过长的目录,一个是白箱、一个是寒蝉,你那边把目录修改得短一点再重新添加一下。比如vcb的就总是很长,一般直接写成“vcb”大家也能看懂。

重新处理添加了,奇怪的是db.xml在github上的diff和本地显示的不一样,出现了大量改变项

@sommio
Copy link
Contributor

sommio commented May 12, 2023

原来Linux上还存在硬编码的字符限制,不通用的解决方法就没有意义了,感谢告知

Linux 文件名长度限制的单位是 bytes,实际可用 85 个 UTF-8 CJK 字符,但没有路径长度限制

Windows 则是没有文件名长度限制,路径长度限制 260 个 UTF-16 字符,1607 后为软限制

@foxofice
Copy link
Owner

每次更新后,需要运行软件按F5更新db.xml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants