Git · Middle · Question 3 of 75
Merge vs rebase for integrating main into a feature branch: what's the trade-off?
- ✓Correct answer: Merge keeps true history; rebase gives a linear one but rewrites commits
- 2Merge is faster to run; rebase is slower but uses less disk space
- 3Merge works only locally; rebase works only with a remote
Explanation
Merge preserves exactly what happened and adds merge commits; rebase produces a clean line that's easier to read and bisect, at the cost of new hashes. Teams pick one convention.