Bird
0
0

You ran git rebase -i HEAD~3 and changed the order of commits, but Git shows a conflict error. What is the best way to fix this?

medium📝 Troubleshoot Q14 of 15
Git - Rebasing
You ran git rebase -i HEAD~3 and changed the order of commits, but Git shows a conflict error. What is the best way to fix this?
AForce push the branch without resolving conflicts
BAbort the rebase with <code>git rebase --abort</code> and try again
CDelete the .git folder and start over
DManually resolve conflicts, then run <code>git rebase --continue</code>
Step-by-Step Solution
Solution:
  1. Step 1: Understand rebase conflict handling

    When conflicts occur during rebase, you must manually fix them in files.
  2. Step 2: Continue rebase after resolving conflicts

    After fixing conflicts, run git rebase --continue to proceed.
  3. Final Answer:

    Manually resolve conflicts, then run git rebase --continue -> Option D
  4. Quick Check:

    Fix conflicts + git rebase --continue [OK]
Quick Trick: Fix conflicts, then continue rebase with git rebase --continue [OK]
Common Mistakes:
  • Ignoring conflicts and force pushing
  • Aborting rebase without trying to fix
  • Deleting .git folder which loses repo data

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Git Quizzes