I have a branch B based off branch master, I want to rebase B onto branch A instead.
My problem is branch A is based off an earlier commit in master than B, so when I try and rebase B onto A it's bringing all the commit history of master since A was split from it.
Normally I would solve this problem with an interactive rebase and manually drop the unwanted commits, however in this case there are too many commits to handle in this way. What I want is a command that will allow me to drop all commits in branch B between it's last common ancestor with A and the tip of master.
IE. A command that drops commits 2-5 in the diagram below from branch B
* 099b4f7 (HEAD -> master) commit_6
| * a4b6a50 (B) some other commit
|/
* 80cfbbc commit_5
* 49c40c9 commit_4
* 2923714 commit_3
* f78ee3c commit_2
| * f6d3601 (A) some commit
|/
* df753e1 commit_1