Rebase vs. Merge

🔍 What you'll learn: Both merge and rebase integrate changes, but they shape your project's history very differently. This visual guide shows exactly what happens under the hood—so you can choose the right approach for your team.

1
The Setup

Imagine your `main` branch has new commits, and your `feature` branch also has new work. Your goal is to integrate the `feature` into `main`.

A
B
main
↖
C
D
feature
Key Point: Both branches share a common ancestor (`A`), but have since diverged. We need to combine the work from commits `C` and `D` with commit `B`.