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

git merge strategy for cherry picks

From
Joshua Jensen <jjensen@workspacewhiz.com>
Date
Mar 23, 2011, 19:06 UTC
Message-ID
<4D8A44AC.20505@workspacewhiz.com>

In this thread, the question was asked about a merge with cherry picks and the reapplication of lines that had been removed: http://kerneltrap.org/mailarchive/git/2010/2/19/23857/thread

Consider this scenario:
     line line  line re-added
      +    -    +!!
A -- B -- C -- F  master
   \  |        /
    - B' --...-    milestone
I branch the milestone branch from A.

There is a fix, B, that needs to go in the milestone. I cleanly cherry-pick it as B'; there are no conflicts.

The fix is decided to be bad and is removed in C.

Later, I merge the milestone branch back to master. The B 'fix' is re-added without conflict.

How can I correctly merge milestone into master without reintroducing the B 'fix'?

In contrast, if I run, say, 'gitk --cherry-pick master...milestone', I see that B' is not considered a difference between master and milestone.

Thanks.
Josh
Message 1 of 1 in “git merge strategy for cherry picks”
  1. Joshua JensenMar 23, 2011

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.