CS FundamentalsHardInfosys · GATE CS

Why is it advised not to run git rebase on commits already pushed to a shared branch?

  1. A. Rebase deletes the remote repository
  2. B. Rebase rewrites commit history, so collaborators' copies diverge
  3. C. Rebase cannot be used with branches
  4. D. Rebase always produces merge conflicts

Correct answer: B. Rebase rewrites commit history, so collaborators' copies diverge

Rebase creates new commits with new hashes; others who based work on the old commits must reconcile a rewritten history.

More Software Engineering, Git and Cloud Basics questions

Exams that ask this topic