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

Recording cherry-picked commits

From
JQJean-Baptiste Quenot <jbq@caraldi.com>
Date
Mar 21, 2008, 12:33 UTC
Message-ID
<ae63f8b50803210533n12645fb3w9a8be601c4cc394@mail.gmail.com>
Hi there,

Cherry-picking is great with Git, both with git-cherry-pick and git-cherry. I use them to pick commits from my development branch to my stable maintenance branch that goes to production.

But when a particular commit is slightly different between the two branches (due to eg a conflict resolution in my stable branch), then git-cherry still lists the commit as only present in the development branch. This is a feature, as documented in the man page, because git-cherry compares the changeset rather than the commit id.

So I'm wondering if there's a way to record the commit ID as being already picked from the development branch to the stable branch, so that it's not listed again when I provide the same arguments to cherry-pick. I was used to this kind of feature with svnmerge, a wrapper script around svn that records cherry-picked commits in a Subversion property called svnmerge-integrated on the root directory. But with Git, what is the best practice for knowing which commits you already picked?

Ideally, the set of already-picked commits would be versioned in the Git repo itself, so that other developers can watch what commits are available to pick as well.

Thanks in advance,
-- 
Jean-Baptiste Quenot
http://caraldi.com/jbq/blog/
Next: Jean-Baptiste Quenot
Message 1 of 8 in “Recording cherry-picked commits”
  1. Jean-Baptiste QuenotMar 21, 2008
  2. Jean-Baptiste QuenotMar 22, 2008
  3. Rafael Garcia-SuarezMar 22, 2008
  4. Junio C HamanoMar 23, 2008
  5. Jean-Baptiste QuenotMar 23, 2008
  6. Johannes SchindelinMar 23, 2008
  7. Rafael Garcia-SuarezMar 23, 2008
  8. Johannes SchindelinMar 23, 2008

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.