由于我的仓库中的一个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

上网百度相关的答案,搜到几个答案都要付费才能看,这真是一个知识付费的年代!!!

Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐