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

Re: Commiting changes onto more than one branch

From
Jakub Narebski <jnareb@gmail.com>
Date
Nov 25, 2009, 16:50 UTC
Message-ID
<m38wdublbq.fsf@localhost.localdomain>
In-Reply-To
<6b4a562b0911250831q332ac3b5m6ee38f59e7a6f391@mail.gmail.com>
Mike Jarmy <mjarmy@gmail.com> writes:
> My question is this:  How do I manage a checkin for a bugfix that
> affects, say, only branches v3, v4, and v5?

Take a look at "Resolving conflicts/dependencies between topic branches early" blog post by Junio C Hamano (git maintainer) at http://gitster.livejournal.com/27297.html

In short the solution is to create separate topic branch for a bugfix, branching off earliest place where it would be relevant, then merge this bugfix branch into all development branches you need (e.g. maint-v3, maint-v4, maint-v5, master).

This means:
  $ git checkout -b fix-frobulator--issue-1235 maint-v3
  <create commit or series of commits>
  
  $ git checkout maint-v3
  $ git merge fix-frobulator--issue-1235
  <resolve conflicts if any>
  $ git checkout maint-v4
  $ git merge fix-frobulator--issue-1235
  <resolve conflicts if any>
  [...]
-- 
Jakub Narebski
Poland
ShadeHawk on #git
Previous: Thomas RastNext: Mike Jarmy
Message 10 of 12 in “Commiting changes onto more than one branch”
  1. Mike JarmyNov 25, 2009
  2. Eugene SajineNov 25, 2009
  3. Mike JarmyNov 25, 2009
  4. Avery PennarunNov 25, 2009
  5. Junio C HamanoNov 25, 2009
  6. Mike JarmyNov 25, 2009
  7. Daniel BarkalowNov 25, 2009
  8. Andreas SchwabNov 25, 2009
  9. Thomas RastNov 25, 2009
  10. Jakub NarebskiNov 25, 2009
  11. Mike JarmyNov 25, 2009
  12. Nicolas PitreNov 25, 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.