解决Windows下“fatal: unable to checkout working tree, warning: Clone succeeded, but checkout failed.
因为我的仓库中的一个read文件的路径太长,导致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