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)
