What happens when Git cannot merge automatically, and how to resolve it manually.
How Git Flags Conflicts
When a conflict occurs, Git marks the conflict boundaries directly in the affected files using conflict markers:
<<<<<<< HEAD
This is my local code change on main branch.
=======
This is the incoming code change from feature branch.
>>>>>>> feature-branchStep-by-Step Conflict Resolution
Open the conflicted files in an editor (VS Code highlights these sections).
Inspect the code and manually choose which changes to keep, removing the markers (
<<<<<<<,=======,>>>>>>>).Stage the resolved files:
git add [filename].Finalize the merge by committing:
git commit -m "Resolve merge conflict".