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

Re: How to merge in different order?

From
PHPeter Harris <git@peter.is-a-geek.org>
Date
Apr 3, 2009, 16:30 UTC
Message-ID
<eaa105840904030930j7d576a61s25677c0dd5d16767@mail.gmail.com>
In-Reply-To
<20090403161208.GC28619@raven.wolf.lan>
On Fri, Apr 3, 2009 at 12:12 PM, Josef Wolf wrote:
Show 12 quoted lines
> Hello,
>
> Given a branch that looks like
>
>  A1  A2  A3  A4  A5
>
> I would like to merge into another branch in the order
>
>  A1  A3  A4  A2  A5
>
> When I merge A3, then A2 is merged also.  git-merge don't seem
> to have an option to omit slurping older commits?

"git merge" merges the entire branch. It sounds like you are looking for "git cherry-pick" instead.

Alternatively, you could run "git rebase -i A1" on the branch before merging it. (See the docs for details)

Peter Harris
Previous: Josef WolfNext: Jeff King
Message 2 of 4 in “How to merge in different order?”
  1. Josef WolfApr 3, 2009
  2. Peter HarrisApr 3, 2009
  3. Jeff KingApr 3, 2009
  4. Josef WolfApr 3, 2009

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.