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

Re: Joining a fixed archive with its continuation

From
Jakub Narebski <jnareb@gmail.com>
Date
Sep 1, 2006, 14:12 UTC
Message-ID
<ed9f3e$cvm$1@sea.gmane.org>
In-Reply-To
<44F81FE5.1040509@arces.unibo.it>
Sergio Callegari wrote:
Show 39 quoted lines
>> If you want to be able to distribute it (or synchronize it between your 
>> laptop and PC _with git!_), you can rewrite the history by either 
>> git-rebase, or by using cg-admin-rewritehist if you are using cogito.
>>
>>   
> I have tried using git-rebase (I do not have cg, at least not yet).
> However I am encountering some problems...
> 
> Everything is fine with the master branch of my continuation archive doing
> 
> git rebase fixed-master master
> 
> (where fixed-master is the master head of the recovered archive)
> This does the trick nicely. I.e. I start with
> 
> A---B---C---D    E---F---G---H---I
> 
> 
> where D is fixed-master and I is master, and I end up with
> 
> A---B---C---D---E'---F'---G'---H'---I'
> 
> plus the older tree E---...---I
> 
> However I am then in trouble with the other branches of the continuation
> archive, which I simply cannot get right...
> In fact, E...I has actually a branch, say at G, like in
> 
> E---F---G---H---I
>          \
>           --M---N
> 
> 
> And I cannot make an M'---N' based at G'... the best that I am
> succeeding in is building an
> 
> E''--F''--G''--M'--N' 
> 
> based on D.

It is where --onto parameter of git-rebase is used. It means you use <upstream> parameter to identify main branch in the continuation archive, <branch> parameter being the branch you want to transplant into main archive (i.e. <upstream>..<branch> being the part you want to transplant/rebase), and '--onto <newbase>' with <newbase> being the new fork point.

So in the abovementioned case, try
        git rebase --onto G' I N 
and tell us if it works.
-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
Previous: Sergio CallegariNext: Johannes Schindelin
Message 2 of 3 in “Joining a fixed archive with its continuation”
  1. Sergio CallegariSep 1, 2006
  2. Jakub NarebskiSep 1, 2006
  3. Johannes SchindelinSep 1, 2006

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.