Jump to content

How do I combine repositories without losing history?


CG

Recommended Posts

I want to merge two repositories (or more) into a single repository without losing history of either repository, but have the full history of both available in the new repo.

I have project1 and project2, each in their own repo (repo1 and repo2). Each project’s folder structure is set up the same—i.e. there’s a “/src” folder, a “/build” folder, etc in each. I want to bring each project (along with history) into a new repo where the /main will eventually (after some tweaking) have a folder structure such as:

  /project1/src
  /project1/build
  /project2/src
  /project2/build

So, in Plastic I imagine doing this as follows: I’d like to have a new repo with a /main branch. And then create two child branches off that (called say “/main/repo1” and “/main/repo2”). And then on each of those child branches import the “/main” branch of each of the two repositories. This would let me have the full history of both on their own branches and then I could merge those two branches together after making changes to the folder structure in each so I could merge as above.

However I can’t figure out how to do this in plastic. Attempting to “pull remote branch” or replicate a repo doesn’t work as desired in this case (I can’t sync a src repo to a specific branch in a target repo, at least not I am aware of).

So first question, is there a way to synchronize an entire source repository to a specific child branch in a destination repository that I want to map as the main for the source repo? If so, how do I do that?

Second question, if there’s no way to do that, then is there any other way to do what I want?

I’m sure others have wanted to combine or split repositories over the years, how have you preserved history in that case?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...