I have read relevant questions about git merge and git rebase on SO, but I still cannot fully understand what is happening under the hood.
Here is our branching situation:
MASTER------------------------
\ \
\ \----Feature B---
\ \
\-----Feature A----------\---Feature A+B
Given 2 feature branches that stem from master at different times, we now want to combine the 2 branches. We want to follow the first rebase then merge
practice, but when we rebase Feature A onto Feature B, we get conflicts. That's expected, because both features (and master) have changes in the same areas. But the strange thing is that the same conflict keeps reappearing after git rebase --continue
. This drives us crazy, so we end up aborting the rebase, and use git merge
. It turns out the conflicts are actually easy to resolve.
My question is two-fold:
- Is
git rebase
suitable for our situation? Or is rebase only good for pulling in a few (e.g., 1 or 2) changes? - What is happening under the hood that causes the same conflict to reappear again and again? My understanding is
rebase
resolves conflicts one at a time, but which commit does it compare, and what does it compare it to?
Relavant posts on SO: