Task in the general case
I was asked a similar problem: reloading the whole backstory - several branches with some connections between them resulting from the merge:
A
If I do multiple git rebase sequentially (for topicB and topicC), I doubt that merges between branches can be saved correctly. Thus, I would have to reload all the branches at once , hoping that this would restore them correctly.
Solution working in a specific subframe
In my case, I was fortunate that topicC was actually merged into topicB, so I could reinstall the whole background, I could just run
git rebase -p A* topicB'
(A * is the new base, as in your question), and then reset all the remaining ref segments (and tags) to the new corresponding commits (in the new history), for example
git branch -f topicC C3'
It worked. (Moving ref links and tags is possible with a script .)
A βsolutionβ for a general case inspired by this particular
If topicC was not merged into topicB, I could create a fake top commit to merge all the branches that I want to reinstall, for example:
git checkout -b fake topicB git merge -s ours topicC
and then reinstall it like this:
git rebase A* fake
and reset the theme goes to new commits, removes the fake branch.
imz - Ivan Zakharyaschev Mar 14 '12 at 17:00 2012-03-14 17:00
source share