Back to All Blogs1 min read16 Sept 2026
Developer Tools
Git Rebase vs Merge: A Practical Mental Model
“Understand how merge and rebase change history and when each approach is appropriate.”
Git Rebase vs Merge
Both merge and rebase integrate work from different Git branches.
A---B---C main
\
D---E feature
Merge
git switch feature
git merge main
Merge preserves existing histories.
Rebase
git switch feature
git rebase main
The result becomes:
A---B---C---D'---E'
D' and E' are new commits with different hashes.
Practical Rule
Rebasing your own local feature work is usually reasonable.
Be more careful rebasing shared branches.
git add .
git rebase --continue
To cancel:
git rebase --abort
Warning
Do not use git push --force casually.
Merge emphasizes preserving branch history. Rebase can produce a simpler linear history.
Finished this article?
Mark it done to update your series progress.