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

Re: combine git repo historically

From
Johannes Sixt <j.sixt@viscovery.net>
Date
Oct 9, 2009, 06:02 UTC
Message-ID
<4ACED204.3000907@viscovery.net>
In-Reply-To
<20091009012254.GA3980@debian.b2j>
bill lam schrieb:
Show 14 quoted lines
> I have two git repos, no branches.
> 
> repo 1.
>   emptyrootcommit -- A ... M 
> 
> repo 2.
>   emptyrootcommit -- N ... Z
> 
> N was evolved from M but the time gap is large, how can I combine them
> into one repo
> 
> emptyrootcommit -- A ... M -- N ... Z
> 
> so that snapshots N .. Z will not be changed.

$ echo $(git rev-parse N) $(git rev-parse M) >> .git/info/grafts $ git filter-branch --tag-name-filter cat -- --all --not M

i.e. you graft the older history right before the younger history, then you use git filter-branch to rewrite the parentship of the younger commits.

-- Hannes
Previous: bill lamNext: Christian Couder
Message 2 of 12 in “combine git repo historically”
  1. bill lamOct 9, 2009
  2. Johannes SixtOct 9, 2009
  3. Christian CouderOct 9, 2009
  4. bill lamOct 10, 2009
  5. Christian CouderOct 11, 2009
  6. bill lamOct 11, 2009
  7. Christian CouderOct 11, 2009
  8. Jakub NarebskiOct 11, 2009
  9. Johannes SixtOct 11, 2009
  10. Christian CouderOct 11, 2009
  11. Jakub NarebskiOct 11, 2009
  12. Andreas SchwabOct 11, 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.