It is really difficult to understand Git rebase for beginner. I always get weird result when I rebase. I found that I can use --onto to control where I should rebase to, but how can I control the from side?
For example:
Let's say I am at branch 2 now, the number represent the time when the commit is done, and red color is my branch-2 commits which are not in master yet. If I want to get my branch 2 become below, what command should I use?
1) 1 -> 2 -> 8 -> 3 -> 5 -> 6 -> 7
2) 1 -> 2 -> 8 -> 5 -> 6 -> 7
In the beginning, I thought this can't be done, because my commit 3 will be gone, but I read it from Git website, this is actually valid.
3) 1 -> 2 -> 3 -> 5 -> 6 -> 8 -> 7
Can I do this? Basically to rebase only commit 7 on top of master?
The reason of asking these are because, auto rebase always give me headache, so I rather to be able to specify, I want to rebase from which commit onto which commit. Am I able to do so? But I can't find the from parameter.


masterpoints toC6for example.