Resolving Merge Conflicts

Merge conflicts occur when Git cannot automatically resolve differences between two branches during a merge.

Process

To resolve conflicts:

# Edit the conflicting files manually
# After resolving conflicts

# Add the resolved files to staging
git add [file]

# Complete the merge
git commit -m "Resolved merge conflict"

Explanation: You need to edit the files showing conflicts, decide how to merge changes, then stage and commit the resolution.

Key Takeaways

  • Merge conflicts require manual intervention to decide the final content.
  • After resolving, you must stage and commit the changes to finalize the merge.