【发布时间】:2020-08-26 13:29:06
【问题描述】:
我之前用--depth 1做了一个git浅克隆
之后,我想从远程获取一个深度为 10 的特定分支并结帐到该分支。
我可以从远程获取分支,但分支未显示在 git branch -a
更换个人信息后的日志如下
User@PC-NAME MINGW64 /d/Folder/application (master)
$ git fetch --depth 10 origin branchname
remote: Counting objects: 18624, done.
remote: Compressing objects: 100% (10327/10327), done.
remote: Total 18624 (delta 12993), reused 12045 (delta 7599)
Receiving objects: 100% (18624/18624), 530.73 MiB | 1.36 MiB/s, done.
Resolving deltas: 100% (12993/12993), completed with 3067 local objects.
From 10.100.x.x:Repository/application
* branch branchname -> FETCH_HEAD
User@PC-NAME MINGW64 /d/Folder/application (master)
$ git branch -a
* master
remotes/origin/HEAD -> origin/master
remotes/origin/master
【问题讨论】:
-
@phd - 上面的问题是关于克隆的。我的问题是关于带有 --depth 选项的 git fetch 。我看了答案,并没有解决问题。批准的答案解决了我的问题,
标签: git shallow-clone