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

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

错误提示以下图:spring

3130-git-clone-file-name-too-long-01.jpg

 


能够有下面的一些解决办法:bash

能够有下面的一些解决办法:ide

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

git config --system core.longpaths true

 

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

添加get

longpaths = true

 

这个配置。it

3130-git-clone-file-name-too-long-02.jpg

而后从新删除已经克隆的目录中除了 .git 的全部目录。class

而后再从新 checkout branch。配置

3130-git-clone-file-name-too-long-03.jpg

 

第 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

相关文章
相关标签/搜索