Two people edit the same sentence in different ways. Which one wins? Git won't guess. It asks you. That question is a merge conflict.
Imagine two friends decorating the same model house while the other isn’t looking. One paints the front door red. The other paints it green. When the house comes back together, it can’t have both. Someone has to decide.
In Git, a merge conflict is exactly that: two branches changed the same lines in different ways, so Git can’t combine them on its own. It stops and asks a person to choose.
What it looks like
Git marks the clashing spot in the file and shows both versions, one after the other. You read them, decide what the result should be, tidy up and save. Then the merge carries on.
How to have fewer of them
- merge small changes often, rather than one huge change at the end
- fetch everyone else's latest work before you start
- agree who's working on which part
What it isn’t
It isn’t a disaster. Nothing is lost: both versions are right there until you choose. Conflicts are an everyday part of working in a team.
It also isn’t Git failing. Most of the time Git combines changes perfectly well by itself. It only asks when two people changed the same thing.
Where the comparison breaks down
A door can only be one colour. With code, the right answer is often a mix of both changes, written by hand.
How the words fit together
Two branches that changed the same lines cause a merge conflict when you merge them. Resolving it means choosing the final version. Rebasing can run into conflicts too, for the same reason.
A merge conflict isn't an error or anyone's fault. It's Git being careful. It refuses to throw away anyone's work without a person deciding.

When you'll hear it
“I've got conflicts.” Git found changes that clash and is waiting for me to choose.
“Resolve the conflict.” Decide which version to keep, or combine the two, then save.
“Pull first to avoid conflicts.” Fetch everyone else's latest changes before you start, so you're working on the newest version.
“Who else is working on this part, so we don't both change it at once?”

Try it yourselfReady to use it? The exact commands are on my other site, devcmds: Fix a merge conflict ↗


