Another git question… I am in the following situation:
A1 ---- B1 ---- C1
\
> D ---- E ---- F
/
A2 ---- B2 ---- C2
Where {A1,B1,C1} and {A2,B2,C2} have no files in common (it’s the consequence of merging two different repositories, so I have currently two roots)
I would like the history to look like this
A1 ---- B1 ---- C1 ---- A2 ---- B2 ---- C2 ---- D ---- E --- F
But I cannot figure out how to do that with git-rebase, any idea?
Bonus: If I can keep the tags (which I have on all three branches) without having to do it manually…
I managed to do it with the following two commands, in sequence:
Of course, you have to replace
<a2>,<c1>,<new head>etc. by the corresponding commit hashes. Note that the head’s hash changes after the first command, which is why I called it<new head>instead of just<d>.It’s actually pretty straightforward: the first command sets C1 as A2’s parent. The second command fixes the graph by setting C2 as D’s only parent.