java - 如何在 git clone 期间修复 "Filename too long error"

标签 java windows git github gitlab

我正在尝试使用以下命令从我的 bitbucket 存储库的特定分支中获取 git 克隆: git clone <url> --branch <branchname> .

但是,我在进行克隆时遇到以下错误:

error:unable to create file foldername/nodemodules/......: Filename too long.

我尝试通过在我的 git cmd 中运行以下命令来解决这个问题 git config --system core.longpaths true .

但我得到:

error: could not lock config file c://.gitconfig: Permission denied error: could not lock config file c://.gitconfig: Invalid argument.

如何解决这两个错误?

最佳答案

  1. 以管理员身份启动 Git Bash
  2. 运行命令 git config --system core.longpaths true

另一种方式(仅适用于此克隆):

git clone -c core.longpaths=true <repo-url>

关于java - 如何在 git clone 期间修复 "Filename too long error",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52699177/

相关文章:

windows - 如何将 bash 脚本输出通过管道传输到 Windows 上的文件

java - 如何使用 PowerShell 处理 Azure 订阅中的多个租户

c++ - 如何从服务获取用户桌面的路径?

git - 从 CVS 迁移到 Git : $Id$ equivalent?

git - 从服务器 pull Git

java - 对于任何产品来说,选择 Nodejs 而不是 ASP.NET 或 Java 有何缺点?

java NIO.2 全局问题

java - 无需 Spring MVC 的自动数据绑定(bind) Java 对象

git - 如何生成类似于 git hash-object 命令的 sha1

java - 如何在 JList 中按属性搜索项目