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

Re: Git (svn) merge - but ignore certain commits?

From
PHPeter Harris <git@peter.is-a-geek.org>
Date
Jan 8, 2009, 20:00 UTC
Message-ID
<eaa105840901081200i2738dael10e2db35b7cb4750@mail.gmail.com>
In-Reply-To
<4966513C.1010707@sneakemail.com>
On Thu, Jan 8, 2009 at 2:17 PM, "Peter Valdemar Mørch (Lists)" wrote:
Show 8 quoted lines
>
> E.g.:
>
> ---A---B---C---D--+ "master"
>    \--E---F---G-/  "branch"
>
> Here I want F and G merged back to "master", but *not* E (which is a
> quick-and-dirty but safe version of B).
Stop and think about that for a second.

Rephrased, "I want to cherry pick a few commits to master using the merge command".

That sounds rather silly when I put it that way. What do you really want? Hmm.

Maybe you want to cherry pick those commits. Maybe (if this is still an unpublished branch), you want to "git rebase --onto B E" your branch to get the non-dirty version of E, then merge.

Or maybe you do want to merge, but you're getting confused by not seeing the automatic conflict markers. You could merge --no-commit the branch, fix the conflicts (E conflicts logically with B, even if 'git merge' doesn't automatically mark it as such -- 'git revert -n E' may even do most of the work), and only then commit the merge revision. Repeated merges from this state will not keep trying to import E (since E is already in the history).

Peter Harris
Previous: Peter Valdemar Mørch (Lists)
Message 6 of 6 in “Git (svn) merge - but ignore certain commits?”
  1. Peter Valdemar Mørch (Lists)Dec 27, 2008
  2. Peter HarrisDec 28, 2008
  3. Peter Valdemar Mørch (Lists)Jan 8, 2009
  4. Peter HarrisJan 8, 2009
  5. Peter Valdemar Mørch (Lists)Jan 8, 2009
  6. Peter HarrisJan 8, 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.