GitHub 克隆给出“文件名太长”

问题描述 投票:0回答:4

当我通过 GitHub Desktop 克隆我的存储库时,它会抛出错误,指出有一个文件名称太长,我知道文件限制是 255,我从 regedit 和策略编辑器禁用了它,但问题仍然发生,我不知道该怎么办

github filenames
4个回答
22
投票

对于任何想知道如何解决这个问题的人,我找到了一种方法! 转到 GitHub 桌面文件夹 -> app -> resources -> app -> git -> mingw64 -> etc -> gitconfig ,然后在 [core] 部分下添加此字段“longpaths = true”:)


9
投票

转到 GitHub 桌面文件夹 -> 应用程序 -> 资源 -> 应用程序 -> git -> 等 -> gitconfig

在 [core] 部分下添加此字段“longpaths = true

对于我的情况:

路径是:

C:\Users\username\AppData\Local\GitHubDesktop\app-3.0.7\resources\app\git\etc

更新文件(gitconfig)格式:

[core]
    symlinks = false
    autocrlf = true
    fscache = true
    longpaths = true

1
投票

转到 GitHubDesktop 文件夹(位于 AppData\Local\GitHubDesktop)> 应用程序 > 资源 > 应用程序 > git > 等 > gitconfig

C:\Users\YourUser\AppData\Local\GitHubDesktop\app-3.1.6\resources\app\git\etc

使用任何可用的程序打开“gitconfig”(我用Windows记事本打开它)并在[核心]部分添加“

longpaths = true

然后保存文件。再次打开 GitHub Desktop 就可以了:)


0
投票

如果您使用 GitHub Desktop 并在签入代码时遇到“文件名太长”问题。应用以下解决方案即可。 转到 - Repository-> Show in Explorer -> .git 使用任何编辑器(例如 Notepad++)编辑 config 文件 - 在 [core] 部分下添加此字段 “longpaths = true” enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.