Software Engineering · Question 30 · Hard

Why should you avoid rebasing commits that have already been pushed to a shared branch that others are using?

  1. Rebasing deletes the branch on the remote
  2. Rebasing rewrites those commits as new commits with new hashes, so collaborators' history diverges from the rewritten branch
  3. Rebasing silently discards every merge conflict
  4. Rebasing works only on the local main branch
Answer and explanation

Answer: B. Rebasing rewrites those commits as new commits with new hashes, so collaborators' history diverges from the rewritten branch

Explanation: git rebase replays commits on a new base, creating new commit objects. Anyone who built on the old commits will see a diverged history and must reconcile it, which can duplicate or lose work.

Previous: In mutation testing, 50 mutants are generated. 5 of them are equivalent…

Practise software engineering

Try a fresh set of software engineering questions with an explanation after every answer, free and without signing up: Software Engineering practice. Or sit a full placement mock test.

More software engineering questions

More technical & programming practice

Cloud & DevOps · GenAI Basics · Pseudo-code · C Programming · Java · Python · Data Structures · Algorithms

LogicWiz Exams home · All practice topics · Placement mock tests · Daily 10 challenge