请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

GIT仓库代码拉取报无效的路径

刚开始学习,在源码拉取时报
invalid path 'docs/Chapter5/dependent-envars.yaml '
unable to checkout working tree
Clone succeeded, but checkout failed.
怀疑是dependent-envars.yaml文件名后有空格导致,因为查看该文件路径时,URL上该文件后有%20

https://git.imooc.com/coding-464/kubeblog/src/master/docs/Chapter5/dependent-envars.yaml
麻烦老师修改一下,好拉取源码成功,谢谢!

正在回答 回答被采纳积分+3

2回答

清风 2021-08-17 11:56:08

我这边没有重现问题,应该是网络原因。


git clone https://git.imooc.com/coding-464/kubeblog.git

Cloning into 'kubeblog'...

remote: Counting objects: 2216, done.

remote: Compressing objects: 100% (1568/1568), done.

remote: Total 2216 (delta 928), reused 1576 (delta 532)

Receiving objects: 100% (2216/2216), 44.41 MiB | 3.42 MiB/s, done.

Resolving deltas: 100% (928/928), done.


0 回复 有任何疑惑可以回复我~
  • 提问者 慕圣3875289 #1
    老师,我用阿里云的Centos主机clone成功了,但是Windows一直报错,我提速到了1.2M/s仍然报
    invalid path 'docs/Chapter5/dependent-envars.yaml '
    unable to checkout working tree
    Clone succeeded, but checkout failed.
    报错的全文:
    >git clone https://git.imooc.com/coding-464/kubeblog.git
    Cloning into 'kubeblog'...
    remote: Counting objects: 2216, done.
    remote: Compressing objects: 100% (1568/1568), done.
    Receiving objects: 100% (2216/2216), 44.41 MiB | 200.00
    
    Resolving deltas: 100% (929/929), done.
    error: invalid path 'docs/Chapter5/dependent-envars.yaml '
    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 :/'
    
    不知道不是与操作系统有关,感觉确实和docs/Chapter5/dependent-envars.yaml路径后有个空格有关,不知道是不是OS和CentOS对空格做过处理,而windows没有导致的,看之前貌似也有同学有这样的问题
    回复 有任何疑惑可以回复我~ 2021-08-17 21:14:59
清风 2021-08-17 07:55:51

执行的命令发一下吧

0 回复 有任何疑惑可以回复我~
  • 我拉取的时候也报这个错误,相同的文件:
    $ git clone https://git.imooc.com/leeshen/kubeblog.git
    Cloning into 'kubeblog'...
    remote: Counting objects: 2240, done.
    remote: Compressing objects: 100% (1590/1590), done.
    remote: Total 2240 (delta 941), reused 1575 (delta 532)
    Receiving objects: 100% (2240/2240), 44.42 MiB | 1.82 MiB/s, done.
    Resolving deltas: 100% (941/941), done.
    error: invalid path 'docs/Chapter5/dependent-envars.yaml '
    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 :/'
    回复 有任何疑惑可以回复我~ 2021-12-16 18:51:48
问题已解决,确定采纳
还有疑问,暂不采纳
意见反馈 帮助中心 APP下载
官方微信