Skip to main content
PreparationZone Logo
PreparationZone
Back to Fundamentals

Fundamentals · Medium · Free

Git merge vs rebase — when to use which?

FresherFundamentalsSoftware Engineering & Tools
Model answer

Merge vs rebase

For Git merge vs rebase — when to use which, interviewers listen for a crisp definition, how the pieces interact in a real system, and one trade-off or failure mode you have seen or would guard against.

MergeRebase
HistoryPreserves branchesLinear
UseShared main, PRsLocal cleanup before push
RiskMerge commitsDon't rebase public shared branches
Golden rule: never rebase commits others already pulled.