Both merge and rebase integrate changes from one branch into another, but they do it differently: merge preserves history with a merge commit, while rebase rewrites history to create a linear sequence. Understanding the difference and when to use each is important.
Merge — preserves history (combines)
main: A───B───C───────M ← M is a MERGE COMMIT (two parents)
\ /
feature: D───E
→ git merge feature: creates M combining the branches
✓ Preserves the actual history (shows the branch existed, when it merged)
✗ History has merge commits (can look cluttered with many merges)
