In short
Merge conflicts look scary the first time, with weird arrows all over your file. They're just Git asking one simple question: which version do you want?
A merge conflict happens when two branches change the same lines. Git marks the conflict in the file, and you decide what the final version should be.

Think of it like this
Two scorers, one scoreboard
Two scorers update the same match sheet. One writes 45 runs for Rohit, the other writes 47. The umpire can't guess, so the sheet is held until someone checks and writes the right number. You're that someone.
Watch it happen
Fixing a conflict calmly
1/6You run git merge feature/new-header. Both branches changed the same <h1> line.
The big ideas
What you need to know
Why it happens
Two branches changed the same lines of the same file. Git won't guess which one is right.
Read the markers
<<<<<<< starts your version, ======= splits them, >>>>>>> ends their version.
You decide the final code
Keep yours, keep theirs, or combine both. Then delete all the marker lines.
add marks it resolved
After fixing the file, git add tells Git that conflict is sorted. Then commit or continue.
See it in code
Walk through the code
1git merge feature/new-header2# CONFLICT (content): Merge conflict in index.html3 4# Inside index.html you'll see:5# <<<<<<< HEAD6# <h1>Welcome to InsideEdge</h1>7# =======8# <h1>Find your dream college</h1>9# >>>>>>> feature/new-header10 11# Edit to the final line, delete the markers, then:12git add index.html13git commit # completes the merge1/4The merge stops and Git names the file that has a conflict.
HEAD is the branch you're on. The part after ======= comes from the branch you're merging in. Stuck? git merge --abort takes you back.
Save yourself the pain
Common mistakes
Oops
Committing a file that still has <<<<<<< lines in it.
Do this instead
Search the file for <<<<<<< before you git add. Leftover markers break your code.
Oops
Always picking your own version to finish fast.
Do this instead
Read both sides. Your teammate's change may be important, and the right answer often combines both.
Your mission
Create a conflict on purpose
Quick check
You've edited the conflicted file and removed the markers. What tells Git the conflict is resolved?
Go deeper
- 1Create a conflict on purpose in a practice repo and resolve it.
- 2Use VS Code's conflict buttons to accept current, incoming or both changes.
- 3Pull often and keep branches short-lived to avoid big conflicts.
Also part of these roadmaps
More topics at this stop
Stuck on this topic? Ask an Insider
Get 1:1 guidance from people who've walked this exact path — on the InsideEdge app.