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

Re: merging branches with separate but identical history

From
Henrik Grubbström <grubba@grubba.org>
Date
Sep 1, 2010, 12:35 UTC
Message-ID
<loom.20100901T142437-744@post.gmane.org>
In-Reply-To
<AANLkTikTzZe=c=RaEYSr_wjfHht4PZihggnV9vEOehvy@mail.gmail.com>
Craig de Stigter <craig.destigter <at> koordinates.com> writes:
> Hi list
Hi.
Show 7 quoted lines
> I have two branches which start with the same commits, and I want to merge
> them.
> I believe the two branches were individually pulled from the same SVN
> repo, so they look like this:
> 
> branch1: a--b--c--d--e--f--1--3--5
> branch2: a--b--c--d--e--f--2--4--6
[...]
> Is there a way to do this without the duplicates? (perhaps a way to
> mark the branch as merged up to 'f', without actually performing a
> merge?)

Yes, you can use grafts (cf gitrepository-layout(5)) to rewrite the parent pointer for eg commit 2 from f(2) to f(1).

> Thanks
> Craig de Stigter
-- 
Henrik Grubbström                                         <grubba@grubba.org>
Roxen Internet Software AB                                <grubba@roxen.com>
Previous: Jonathan Nieder
Message 3 of 3 in “merging branches with separate but identical history”
  1. Craig de StigterAug 31, 2010
  2. Jonathan NiederAug 31, 2010
  3. Henrik GrubbströmSep 1, 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.