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

Understanding git cherry-pick

From
SBStephen Bash <bash@genarts.com>
Date
Nov 10, 2010, 14:04 UTC
Message-ID
<28509694.654669.1289397869374.JavaMail.root@mail.hq.genarts.com>
In-Reply-To
<10192863.654644.1289397257054.JavaMail.root@mail.hq.genarts.com>
Hi all-
In helping a coworker yesterday with a git cherry-pick operation, I found my mental model of cherry-pick seems to be flawed.  Our goal was to cherry-pick one commit from the current development branch back to the stable release branch (we're still training everyone on the *correct* way to do maintenance fixes).  Here's what happened:
$ git checkout release-branch
$ git cherry-pick 8815f3a0c2c248db223e41b0538f0c48b45fe52d
warning: too many files (created: 237 deleted: 2558), skipping inexact rename detection
Automatic cherry-pick failed.  After resolving the conflicts, mark the corrected paths with 'git add <paths>' or 'git rm <paths>' and commit the result with:
   git commit -c 8815f3a0c2c248db223e41b0538f0c48b45fe52d
git status reported the actual change we wanted from the commit applied cleanly; the conflicts were all added/deleted files between the two branches.  The commit only modifies a single file, and the file exists with the same name on both branches.
So what's actually going on here?  If the one changed file in the commit merged cleanly, why did the automatic cherry-pick fail?  Why does cherry-pick even care about file differences between the two branches that aren't modified by the commit in question?  Or is it user error?

Thanks, Stephen

Next: Camille Moncelier
Message 1 of 3 in “Understanding git cherry-pick”
  1. Stephen BashNov 10, 2010
  2. Camille MoncelierNov 10, 2010
  3. Stephen BashNov 10, 2010

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.