Zarówno merge jak i rebase integrują zmiany z jednej gałęzi do drugiej, ale robią to w różny sposób: merge zachowuje historię z commitem merge, podczas gdy rebase przepisuje historię, aby utworzyć liniową sekwencję. Zrozumienie różnicy i kiedy użyć każdego z nich jest ważne.
Merge — zachowuje historię (łączy)
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)
