mergeとrebaseはどちらも1つのブランチから別のブランチへ変更を統合しますが、方法が異なります。mergeは履歴を保持してマージコミットを作成し、rebaseは履歴を書き直して線形のシーケンスを作成します。それぞれの違いと使い分けを理解することが重要です。
Merge — 履歴を保持する(統合する)
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)
