merge और rebase दोनों एक branch से दूसरी में बदलाव एकीकृत करते हैं, लेकिन वे इसे अलग ढंग से करते हैं: merge एक merge commit के साथ इतिहास को संरक्षित करता है, जबकि rebase एक रैखिक अनुक्रम बनाने के लिए इतिहास को rewrite करता है। अंतर और प्रत्येक का कब उपयोग करना है यह समझना महत्वपूर्ण है।
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)
