'git rebase and keep branches of rebased branch

When I have a git graph that lookslike this:

A - B - C
      \
        E - F - G - H
          \       /
            I - J

is it possible and if yes what commands do I need to use to come to a structure that is like this:

A - B - C - E - F - G - H
              \       /
                I - J

I have tried git rebase with lots of options but I haven't come to the result i want.

I tried with the --onto option but it creates a single trbranchee and I need to solve conflict manually.



Solution 1:[1]

We can try using git rebase --onto here:

# from branch whose head is commit H
git rebase --onto C B

The says to place the E commit (whose parent is commit C) on top of a new base which is the the C commit.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Tim Biegeleisen