当前位置:   article > 正文

git clone代码报错:fatal: unable to checkout working tree

unable to checkout working tree

git clone代码报错:fatal: unable to checkout working tree

错误信息

Receiving objects: 100% (15586/15586), 175.20 MiB | 13.49 MiB/s, done.
Resolving deltas: 100% (3781/3781), done.
error: invalid path 'addons/we7_wmall/thirplatform /keruyun/Keruyun.php'
fatal: unable to checkout working tree
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry with 'git restore --source=HEAD :/'
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7

错误原因: 文件名太长,无法签出工作树警告:克隆成功,但签出失败。

解决办法1

配置git
通过命令设置:git config --system core.longpaths true
在这里插入图片描述执行命令

PS D:\wwwroot\www.ch.com> git restore --source=HEAD :/
  • 1

然后再次使用以下命令强制拉取远程代码并覆盖本地:

git fetch --all
git reset --hard origin/master
git pull
  • 1
  • 2
  • 3

再次使用 git status 命

声明:本文内容由网友自发贡献,转载请注明出处:【wpsshop博客】
推荐阅读
相关标签
  

闽ICP备14008679号