Skip to content
Commitpedia
Log in Join & edit

What is a merge conflict?

A merge conflict happens when two branches changed the same lines and Git needs a human to decide which version wins.

Drafted with AI from official documentation. Scripts were run in a test environment and repository links verified. Awaiting a human check. Did it work for you? Last edited Outdated?

Edit history of What is a merge conflict?: 1 recorded edit
Edit history · 1 edit
Type
Article
Edits
1
Editors
1
First issued
15 Oct 2026
Last edit
15 Oct 2026
Reading
1 min

A merge conflict is Git’s way of saying that it cannot combine two sets of changes automatically. Two people edited the same sentence in a shared document and each wrote something different; the software cannot guess who is right. Git marks the clashing lines in the file and pauses the merge until you choose.

Conflicts show up when you run git merge, git pull or git rebase and someone else touched the same lines. The file then contains markers like <<<<<<<, ======= and >>>>>>> around the two versions. You edit the file so it reads correctly, remove the markers, stage it and finish the merge. Small, frequent merges make conflicts rare and tiny.

git status
git add app.py
git commit

See also: What is a branch? and What is a pull request?

Did this work for you?

No votes yet. Be the first.

If it did not work, the report form below tells the editors what went wrong.

See also

  • 0034 Merging vs rebasing in Git Merge and rebase both bring commits from one branch into another. Merge keeps history exactly as it happened; rebase replays your commits… Intermediate · Explains an idea · Any system Article Branching & rebasing 15 Oct 2026
  • 0041 Fix: CONFLICT (content): Merge conflict in … Two branches changed the same lines and Git cannot choose for you. Open the file, keep the right text, remove the markers,… Intermediate · Fixes an error · Any system Article Branching & rebasing · Common errors 15 Oct 2026
  • 0262 Make your first pull request: Git and GitHub from first commit to merged change A complete beginner's path through Git and GitHub: set up Git, make commits, ignore files, use branches, push to GitHub, open a… Beginner · Guided project · Any system Article Branching & rebasing · Pull requests · Setup 15 Oct 2026
  • 0269 What is a commit? A commit is a saved snapshot of your project in Git, with a message explaining what changed and why. Beginner · Explains an idea · Any system Article Branching & rebasing 15 Oct 2026
  • 0270 What is a branch? A branch is a separate line of work in Git, so you can try changes without touching the main version of the… Beginner · Explains an idea · Any system Article Branching & rebasing 15 Oct 2026

History

Every saved edit is kept. The plot on the sleeve draws one line per edit. Open any edit to see exactly what changed.

  1. Dominik +795 chars

Report a problem

Something wrong, unsafe or copied? Tell the editors.
What is wrong?