标签云

微信群

扫码加入我们

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年08月16日24分49秒

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

2018年08月15日24分49秒

git branch -a will list all of them

2018年08月15日24分49秒

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年08月16日24分49秒