[英]git branch -a does not show all remote branches
My remote git server has 2 branches, develop and release. 我的远程git服务器有2个分支,开发和发布。
I've cloned the repository, but when I do git branch -a
I see: 我克隆了存储库,但是当我做
git branch -a
我看到:
* develop
remotes/ghe/HEAD -> ghe/develop
remotes/ghe/develop
I tried to do a git fetch
but it did not update the list. 我试着做一个
git fetch
但它没有更新列表。
By running git clone
with a --depth
of 1, you're creating a shallow clone . 通过运行
--depth
为1的git clone
,您将创建一个浅层克隆 。 The behavior you saw is the default behavior without specifying --no-single-branch
to get the tips of all branches, instead of the most recent single branch. 您看到的行为是默认行为, 没有指定
--no-single-branch
来获取所有分支的提示,而不是最近的单个分支。 By not specifying this option, you're just getting the primary branch where the remote HEAD
is pointing to. 通过不指定此选项,您只需获取远程
HEAD
指向的主分支。
If you wanted a shallow clone with the tips of all branches the solution would have been to specify the option --no-single-branch
. 如果你想要一个带有所有分支提示的浅层克隆,解决方案就是指定选项
--no-single-branch
。
For more information, take a look at the documentation on git clone
. 有关更多信息,请查看有关
git clone
的文档。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.