解决Windows下“fatal: unable to checkout working tree, warning: Clone succeeded, but checkout failed.”
由于我的仓库中的一个pdf文件的路径太长,导致clone到本地之后无法checkout,而在Ubuntu下没有任何问题,在这里吐槽一下Windows.git clone xxx.gitCloning into 'xxx'...remote: Enumerating objects: 1503, done.remote: Counting objects: 100% (210/210), done.
文章共331字 · 阅读需要大约2分钟
一键AI生成摘要,助你高效阅读
问答
·
由于我的仓库中的一个pdf文件的路径太长,导致clone到本地之后无法checkout,而在Ubuntu下没有任何问题,在这里吐槽一下Windows.
git clone xxx.git
Cloning into 'xxx'...
remote: Enumerating objects: 1503, done.
remote: Counting objects: 100% (210/210), done.
remote: Compressing objects: 100% (156/156), done.
remote: Total 1503 (delta 72), reused 182 (delta 47), pack-reused 1293
Receiving objects: 100% (1503/1503), 1.42 GiB | 592.00 KiB/s, done.
Resolving deltas: 100% (583/583), done.
error: invalid path 'trajectory/paper/An Introduction to Trajectory?
Optimization: How to Do Your?
Own Direct Collocation.pdf'
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 :/'
从错误提示中可以看出,由于一个文件导致的问题。
操作方法:
git reset
git config core.protectNTFS false
git checkout
上网百度相关的答案,搜到几个答案都要付费才能看,这真是一个知识付费的年代!!!
更多推荐
已为社区贡献3条内容
所有评论(0)