Re: Pull from one branch to another?
- From
Junio C Hamano <junkio@cox.net>
- Date
- Sep 29, 2005, 06:35 UTC
- Message-ID
- <7vbr2cmle2.fsf@assigned-by-dhcp.cox.net>
- In-Reply-To
- <433B84BD.8030003@pobox.com>
Jeff Garzik <jgarzik@pobox.com> writes:
> My question: is this the best/right way to pull one branch into > another? It's been working for me, for months, but...
Yes, that is how 'resolve' is designed to work.
You could instead use standard 'git pull' from the local repository. Here is what I usually do in git.git repository:
$ git checkout foo
$ ... work in foo "topic" branch
$ git checkout bar
$ ... work in bar "topic" branch
$ git checkout pu
$ git pull . foo barEnd result: foo and bar branches are pulled from the local repository and merged into pu branch, as an Octopus.
Of course, I could instead:
$ git checkout pu
$ git pull . foo
$ git pull . barto pull 'foo' and then 'bar' in sequence, which is easier if these topic branches touch overlapping area, because Octopus does not allow manual resolving. On the other hand if I know foo and bar are independent work, there is no point recording the order of merges (merging foo first and then bar does not have any significance) and I tend to let Octopus to happen.