When two branches diverge, Git computes the merge base — the most recent commit reachable from both. The default strategy (ort, replacing recursive in modern Git) does:
- Diff merge base → your branch.
- Diff merge base → their branch.
- Combine. Where one side changed and the other didn't, take the change. Where both changed the same lines, that's a conflict.
Tools to inspect:
git merge-base main feature — show the ancestor.
git diff main...feature — three-dot diff: what feature added since the merge base.
git log main..feature — commits on feature that aren't on main.
Knowing this is what unblocks you when "I rebased and now there are conflicts I already resolved" — the merge base moved.