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

Re: Newbie falls at first hurdle

From
Martin Langhoff <martin.langhoff@gmail.com>
Date
Sep 18, 2005, 19:06 UTC
Message-ID
<46a038f90509181206643bce7@mail.gmail.com>
In-Reply-To
<200509181347.11403.alan@chandlerfamily.org.uk>
On 9/19/05, Alan Chandler <alan@chandlerfamily.org.uk> wrote:
> Still struggling with how to cherry pick parts a previous update (between
> possibly two other branches) and apply them to a current branch - all the
> tutorials assume you want it all, and I can't really understand what the
> cherry pick commands do from their manuals.
Forget the cherry pick commands -- here's a usable, easy strategy.

git-checkout the "source" branch, create a temporary directory to hold the patches, and call

    git-format-patch --mbox -o patchdir destbranch

This will create one file per patch in the destination directory. Feel free to delete patches you don't want, and edit the patches you've got there. Then switch to the destination branch, and use git-applymbox to merge them in.

If you do this repeatedly, git-format-patch will not reexport patches you've merged to the destination branch already (if they merged cleanly unchanged)... or at least that's the theory ;)

The only limitation I've found in this strategy is that it doesn't deal with binary objects. I'm lost as to what to do in those cases.

cheers,
martin
Previous: Sven VerdoolaegeNext: Horst von Brand
Message 10 of 13 in “Re: Newbie falls at first hurdle”
  1. Horst von BrandSep 18, 2005
  2. Martin LanghoffSep 18, 2005
  3. Alan ChandlerSep 18, 2005
  4. Junio C HamanoSep 18, 2005
  5. Linus TorvaldsSep 18, 2005
  6. Junio C HamanoSep 18, 2005
  7. Alan ChandlerSep 18, 2005
  8. Junio C HamanoSep 18, 2005
  9. Sven VerdoolaegeSep 19, 2005
  10. Martin LanghoffSep 18, 2005
  11. Horst von BrandOct 3, 2005
  12. Horst H. von BrandJan 13, 2007
  13. Shawn O. PearceJan 13, 2007

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.