Bird
0
0

You ran git merge feature but got a conflict error. What is the best way to resolve this?

medium📝 Troubleshoot Q6 of 15
Git - Cherry-Pick and Advanced Merging
You ran git merge feature but got a conflict error. What is the best way to resolve this?
ADelete the <code>feature</code> branch and try again
BUse <code>git reset --hard</code> to discard all changes
CRun <code>git merge --abort</code> and ignore the conflict
DManually edit conflicting files, then run <code>git add</code> and <code>git commit</code>
Step-by-Step Solution
Solution:
  1. Step 1: Understand merge conflicts

    Conflicts occur when changes overlap. They must be resolved manually by editing files.
  2. Step 2: Resolve and complete merge

    After editing, stage changes with git add and finish merge with git commit.
  3. Final Answer:

    Manually edit conflicting files, then run git add and git commit -> Option D
  4. Quick Check:

    Resolve conflicts manually then commit [OK]
Quick Trick: Edit conflicts, add files, then commit merge [OK]
Common Mistakes:
  • Deleting branches to fix conflicts
  • Aborting merge without resolving
  • Resetting hard loses work

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Git Quizzes