is this behaviour expected for "git clone --single-branch"?
- From
Ralf Thielow <ralf.thielow@gmail.com>
- Date
- Sep 13, 2012, 18:38 UTC
- Message-ID
- <CAN0XMOJsVOCzp2_BOQVUKy3cV8JA9AG+=Bw4tC2ZzDfK0AcQVg@mail.gmail.com>
Hi,
I know people which have a separate directory for every branch. In this case it doesn't make sense to download the whole repo with all branches. So I guess the "--single-branch" option is the solution in that case!?! But I'm wondering about it's behaviour.
# first clone the branch of the repo $git clone --single-branch --branch master myrepo ./master $cd master
# now calling "git branch -a" to see what I have $git branch -a *master remotes/origin/HEAD -> origin/master remotes/origin/master
# fine, now pulling from origin $git pull From myrepo * [new branch] foo -> origin/foo * [new branch] bar -> origin/bar ...
Hm?
# looking again to my branches $git branch -a *master remotes/origin/HEAD -> origin/master remotes/origin/master remotes/origin/bar remotes/origin/foo ...
After cloning (or fetching), I now have all branches which is not what I want, because I'm only interested in the one I've cloned. I think it's not very useful for the use-case of having one directory for one branch.
$git version git version 1.7.12.395.g6b149ce
Thanks