I want to append two unrelated branches together. Let's say I have something like this:
a---b---c---d (A)
A---B---C---D---E---F (branch)
/
e---f---g---h (B)
I want the result to be:
A'---B'---C'---D'---E'---F' (branch)
/
a---b---c---d---e'---f'---g'---h'
I tried with git rebase --onto d e (HEAD is B) but I get conflicts, and my intention is only to append the commits with THEIR content, not to check two commits and see the differences and solve the conflicts. In other words I want the parent of e witch initially is not set to be d. How can I achieve this?
You can certainly cut-and-paste to form the architecture that you describe. You will have to proceed in two stages because the A-F branch will not magically come with you.
Your diagram is very unfortunate because you have used some names twice. I will try to disambiguate by using better names. Start with this:
So first:
That will give you:
But A-F has been left behind. So now:
But you cannot prevent merge considerations from happening; a rebase is a merge. (More precisely: a rebase is a series of cherry-picks, and a cherry-pick is a merge.) Just to remind you why that is: you cannot in any way edit a commit, including moving it (giving it a different parent). The only way to apparently rearrange the architecture is to make all new commits that are effectively like copies of your original commits. But the only way that Git will make new commits out of whole cloth is by merge logic. You can add
to resolve any conflicts automatically in favor of the copied commits, but you cannot not merge.