Skip to content
Back to library
intermediateMerging & Rebasing

Merge Conflicts

The Definition

Merge conflicts occur when Git cannot automatically resolve differences between branches.

Mental Model

"A conflict is like two people editing the same sentence differently. Git marks the conflicts and lets you decide which version to keep or how to combine them."

Visual Simulation

Live Engine
<<<<<<< HEAD
const user = "Alice";
=======
const user = "Bob";
>>>>>>> feature
const user = "Alice & Bob";
Resolution Success

Watch Out (Common Pitfalls)

!

Panic when seeing conflict markers

!

Choosing the wrong side of a conflict

!

Forgetting to git add after resolving conflicts

Hands-on Command

shell
~ $git status (shows conflicted files) git add (after resolving)