Merge versus rebase: how do you decide?
IntermediateConceptMerge, rebase and cherry-pick
Answer
Rebase to keep a linear, readable history for your own unpublished work and to update a feature branch with latest main. Merge when you want to preserve the true integration history or when a branch is shared by several people. The golden rule: never rebase commits others have based work on. Many teams combine them: rebase locally, squash-merge on the platform.
More on Merge, rebase and cherry-pick
What is the difference between a fast-forward merge and a merge commit?BeginnerHow does a three-way merge work?IntermediateWhat does `git rebase` actually do?IntermediateWhat are squash merge, merge commit and rebase-and-merge on GitHub?IntermediateWhy does a squash-merged branch show as unmerged to `git branch --merged`?IntermediateWhat does `git cherry-pick` do?Beginner