我正在尝试使用以下命令从我的 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.
如何解决这两个错误?
最佳答案
- 以管理员身份启动 Git Bash
- 运行命令
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/