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

Re: What is the best way to backport a feature?

From
Pascal Obry <pascal@obry.net>
Date
Nov 29, 2009, 16:49 UTC
Message-ID
<4B12A631.8020200@obry.net>
In-Reply-To
<loom.20091129T164518-669@post.gmane.org>
Le 29/11/2009 17:28, Peter Weseloh a écrit :
Show 25 quoted lines
> Hi,
>
> Suppose I have the following situation:
>
>    o--o--o                    Release_1.0
>   /    \  \
> o-o-o--o--o-o-o-o-o-o---o--o Mainline
>       \       \       \ /
>        F1--F2--M1--F3--M2     Feature_A
>
> Now I want to backport "Feature_A" to the "Release_1.0" branch so that it gets
> included into the next minor release, i.e. I want to apply the commits F1, F2
> and F3 onto the "Release_1.0" branch.
> I cannot just merge "Feature_A" into "Release_1.0" because that would also bring
> in the merges M1 and M2 so a lot of other stuff from the Mainline.
>
> I played with cherry-pick but that means I have to manually find the commits F1,
> F2 and F3 (which in reality could be many more if Feature_A is big) which is not
> very nice.
>
> I also tried 'rebase -i' but that means I have to manually delete all the lines
> for changesets from the mainline. Also not very nice.
>
> Is there a better way? To me this scenario sounds not unusual but I could not
> find a solution.
In such a case I would use a rebase onto:
    $ git co Feature_A
    $ git rebase --onto Release_1.0 F1 F3
Then
    $ git co Release_1.0
    $ git merge Feature_A
Pascal.
-- 
--|------------------------------------------------------
--| Pascal Obry                           Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--|    http://www.obry.net  -  http://v2p.fr.eu.org
--| "The best way to travel is by means of imagination"
--|
--| gpg --keyserver keys.gnupg.net --recv-key F949BD3B
Previous: Pascal ObryNext: Michael J Gruber
Message 4 of 10 in “What is the best way to backport a feature?”
  1. Peter WeselohNov 29, 2009
  2. Björn SteinbrinkNov 29, 2009
  3. Pascal ObryNov 29, 2009
  4. Pascal ObryNov 29, 2009
  5. Michael J GruberNov 29, 2009
  6. Greg A. WoodsNov 30, 2009
  7. Fwd: What is the best way to backport a feature?Peter Weseloh, Nov 29, 2009
  8. Johannes SixtNov 29, 2009
  9. Peter WeselohNov 29, 2009
  10. Björn SteinbrinkNov 29, 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.