ทั้ง merge และ rebase ผสานการเปลี่ยนแปลงจาก branch หนึ่งเข้ากับอีก branch หนึ่ง แต่ทำต่างกัน: merge รักษาประวัติ ด้วย merge commit ในขณะที่ 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)
