I sometimes find myself in the situation below and want to rebase C onto B:
B
/
A
\
C <-- HEAD
I find that if I simply do git rebase B
, I often get lots of warnings about "falling back to merge strategy" and "automatically resolving" conflicts. Sometimes I straight up get a conflict.
So what I've taken to doing instead is git rebase A --onto B
. This almost always succeeds with no warnings or conflicts.
I don't really understand the difference between these 2 commands and why the first one is more problematic. Is there a less cumbersome way to do what I want without having to specify 2 different commits?
(for example: git rebase --some-magic-switch B
)?
EDIT: Just for added clarity, the desired result is:
A -- B -- C' <-- HEAD
Both git rebase B
and git rebase A --onto B
get me to the desired result. The only difference is that the first one produces warnings and sometimes conflicts.