Search GimmeJob

Type at least 2 characters. Enter also searches by meaning.
QA interview question
InfrastructureMiddleOccasionalTheory

What trade-off do merge and rebase make when integrating branch history?

Answer

Merge preserves the existing branch topology with a merge commit; rebase rewrites commits onto a new base for a linear history. Do not rebase shared history without coordination, and choose based on repository policy and audit needs.

Strong answer includes

  • history preservation versus rewrite
  • shared-history safety
  • policy context

Practical example

A junior engineer rebases a branch that three other people are already working off of, rewriting its commit hashes and forcing everyone else into a confusing history conflict the next morning. The team's policy afterward is: rebase freely on your own unpushed branch, but only merge once a branch is shared.

#git#merge#rebase

Sources

Git referenceGit Project · Version control concepts and commands