git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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 bar

End 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 . bar

to 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.

Previous: Jeff GarzikNext: Alan Chandler
Message 2 of 7 in “Pull from one branch to another?”
  1. Jeff GarzikSep 29, 2005
  2. Junio C HamanoSep 29, 2005
  3. Use of the -f flag on checkoutAlan Chandler, Sep 29, 2005
  4. Matthias UrlichsSep 29, 2005
  5. Junio C HamanoSep 29, 2005
  6. Junio C HamanoSep 29, 2005
  7. Tony LuckSep 29, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.