Bird
0
0

After mistakenly rebasing a public branch and pushing it, your teammates face conflicts. What is the best corrective action?

medium📝 Troubleshoot Q6 of 15
Git - Rebasing
After mistakenly rebasing a public branch and pushing it, your teammates face conflicts. What is the best corrective action?
AAsk teammates to delete their local repositories and clone again
BDelete the remote branch and create a new one with the rebased commits
CCoordinate with teammates to reset their branches and force-push a corrected history
DIgnore the conflicts and continue working on the rebased branch
Step-by-Step Solution
Solution:
  1. Step 1: Identify problem

    Rebasing public branches rewrites history, causing conflicts for collaborators.
  2. Step 2: Best fix

    Coordinate with teammates to reset their local branches to the new history and force-push the corrected branch.
  3. Step 3: Why others are wrong

    Deleting and recreating branches or recloning is disruptive; ignoring conflicts causes ongoing issues.
  4. Final Answer:

    Coordinate with teammates to reset their branches and force-push a corrected history -> Option C
  5. Quick Check:

    Fix rebased public branch by team coordination and force push [OK]
Quick Trick: Fix rebased public branch by team reset and force push [OK]
Common Mistakes:
  • Deleting remote branches unnecessarily
  • Telling teammates to reclone instead of reset
  • Ignoring conflicts caused by rebasing

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Git Quizzes