I don't know git very well. :-/
Background
I have two unrelated git-based document repositories that I would like to combine into a single repository. I would like to preserve the original timestamps (dating back to 2005) and individual file histories. The two repos contain no branches, no folders, and there is no overlap in terms of file naming.
In ASCII-land, it looks like this:
REPO A |-------------------------|
REPO B |===============|
Where the overlap denotes time.
Goal
My goal is to "zipper up" the overlapping timestamps so that the two repos look like a single, unbroken history:
REPO A+B |-------------------==--=---============|
What I've Tried
Again, I don't know git very well, so I could have screwed something up.
First I tried to add the newer, smaller repo as a remote for the larger, older repo, fetch the changes, and commit the result. I ended with all the new repo changes lumped together in a branch after the older repo:
MERGE |------------------------- -|
\===============/
Next I tried rebasing (with --committer-date-is-author-date
), which I thought would work, but instead I end up with one long commit history that just stacks the two repos on top of each other.
REBASE |-------------------------===============|
I haven't been able to find a way to "replay" the combined history. I was really hoping rebase would be the answer.
Answers I've Looked At
- Merge two Git repositories without breaking file history (#1)
- git rebase without changing commit timestamps (#2 above, did not "zipper" histories)
- How to combine two separate unrelated Git repositories into one with single history timeline
- combining unrelated git repositories retaining history/branches