我正在尝试使用以下命令从我的 bitbucket 存储库的特定分支获取 git 克隆: git clone <url> --branch <branchname>
。
但是,在进行克隆时出现以下错误:
错误:无法创建文件 foldername/nodemodules/……:文件名太长。
我尝试通过在我的 git cmd git config --system core.longpaths true
中运行以下命令来解决这个问题。
但我得到:
错误:无法锁定配置文件 c://.gitconfig:权限被拒绝 错误:无法锁定配置文件 c://.gitconfig:参数无效。
我该如何解决这两个错误?
原文由 knowledge20 发布,翻译遵循 CC BY-SA 4.0 许可协议
git config --system core.longpaths true
另一种方式(仅适用于此克隆):
git clone -c core.longpaths=true <repo-url>