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

Re: Merging (joining/stiching/rewriting) history of "unrelated" git repositories

From
Piotr Krukowiecki <piotr.krukowiecki@gmail.com>
Date
May 16, 2019, 06:10 UTC
Message-ID
<CAA01CsrAPfE+hMwNMEF7epRcFQyhdeBxm9qSH=eF6v3kyyMu2w@mail.gmail.com>
In-Reply-To
<874l5vwxhw.fsf@evledraar.gmail.com>

On Wed, May 15, 2019 at 5:25 PM Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote:

Show 12 quoted lines
>
>
> On Wed, May 15 2019, Piotr Krukowiecki wrote:
>
> > Hello,
> >
> > I'm migrating two repositories from svn. I already did svn->git
> > migration (git-svn clone) and now have two git repositories.
> >
> > I would like to merge them into 1 git repository, but to merge also
> > history - branches and tags.
> >
[...]
Show 17 quoted lines
> > There's additional difficulty of handling merges...
> >
> You might be able to use https://github.com/newren/git-filter-repo
>
> But I'd say try something even more stupid first:
>
>  1. Migrate repo A to Git
>  2. Migrate repo B to Git
>  3. "git subtree add" B's history to A
>  4. "git rebase" the history to linear-ize it
>
> At this point you'll have A's history first, then B. Then run some
> script to date order the commits, and just "git cherry-pick" those in
> the order desired in a loop to a fresh history.
>
> Maybe that sort of stupidity will wreck your merges etc., so you might
> need less stupid methods :)

I think both git-filter-repo and the subtree+rebase do not handle branches/merges well :(

-- 
Piotr Krukowiecki
Previous: Piotr Krukowiecki
Message 8 of 8 in “Merging (joining/stiching/rewriting) history of "unrelated" git repositories”
  1. Piotr KrukowieckiMay 15, 2019
  2. Ævar Arnfjörð BjarmasonMay 15, 2019
  3. Elijah NewrenMay 15, 2019
  4. Piotr KrukowieckiMay 16, 2019
  5. Piotr KrukowieckiMay 17, 2019
  6. Jakub NarebskiMay 20, 2019
  7. Piotr KrukowieckiMay 21, 2019
  8. Piotr KrukowieckiMay 16, 2019

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.