标签云

微信群

扫码加入我们

WeChat QR Code

为什么不

This question already has an answer here:

If I do

$ git clone https://github.com/dtu-compute/docker-mongodb
$ cd docker-mongodb
$ git branch
* master

but if you look at the Github branch page, there are two branches.

Question

Why don't I get all the branches with git clone?


if you checkout the branch you will see it works fine

2018年05月24日11分58秒

But why isn't it listed? have it something to do how the branch were pushed?

2018年05月23日11分58秒

git branch -a will list all of them

2018年05月23日11分58秒

If a remote repo has no master branch, you may ask why git clone clones nothing. In fact, it clones everything if no option like --single-branch or --depth is used. They are hidden at first. git branch only lists the local branches.

2018年05月23日11分58秒