zl程序教程

您现在的位置是:首页 >  其他

当前栏目

Git Clone 的时候遇到 Filename too long 错误

错误Git Git 错误 遇到 时候 too long
2023-09-27 14:20:34 时间

在对某些仓库进行 Git Clone 的时候遇到了 Filename too long 的错误提示。

错误提示如下图:

 


可以有下面的一些解决办法:

可以有下面的一些解决办法:

在 Git bash 中运行下面的命令,来进行 git 配置的全局修改:

git config --system core.longpaths true

 

在 Clone 仓库出现上面的错误后,进行已经克隆的目录中,然后找到 .git 目录的 config 文件。

添加

longpaths = true

 

这个配置。

然后重新删除已经克隆的目录中除了 .git 的所有目录。

然后再重新 checkout branch。

 

第 3 种办法就是在 Check out 的时候添加参数。

例如使用下面的命令进行 check out。

在 Clone 的时候添加 -c core.longpaths=true 参数。

例如使用下面的命令进行 clone

git clone -c core.longpaths=true "https://src.ossez.com/spring/spring-boot.git" "C:\WorkDir\spring-boot"

 

你应该能够没有问题的解决这个问题。

https://blog.ossez.com/archives/3130