2

I'm in the process of moving a mature repository from an old revision control system (that shall remain nameless) to git. Since the old system doesn't seem to be used by anyone else there's no official importer but I found a basic one on Github which I've improved a bit. Unfortunately it only handles a single stream so my plan is:

  1. Convert the trunk to git.
  2. Convert each release branch for the last few years to git (so we have a complete history to maintain support for released versions).
  3. Stitch each of these release branches into the converted trunk at the point where they were created so we have an accurate history.

My knowledge of git is pretty basic so I have no idea how to do step 3. Any suggestions?

parsley72
  • 8,449
  • 8
  • 65
  • 98

1 Answers1

1

This answer addressed stiching git repos together in order to get one coherent history.
But it produces one branch.

In your case, you have the history of several branches that should be linked into one repo (with, as a result, several branches).

That sounds like a job for git filter-branch, as suggested in "combining unrelated git repositories retaining history/branches".
The same page suggests also the python script splice_repos.py, detailed in the blog post "Splicing git repositories together".

  • Each branch contains a sequence of commits from both repositories, interleaved in the order they were originally committed
  • The process is repeatable, and generates the same hashes for commits when run again
  • The process can be done incrementally (so that we can start working on the new repository for some branches, while older branches are still maintained in the old repos)

In other words, here, don't stich, splice.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250