Skip to content

Conflict

← All terms · Git fundamentals

Also called Merge conflict

An event that occurs when Git cannot automatically merge two branches because the exact same lines of code were modified differently in both.

What it is

A conflict pauses a merge or rebase process. Git halts and modifies the affected files with special conflict markers, showing both conflicting versions of the code. A human developer must manually edit the files to choose which code to keep, delete the markers, and save the file to resolve the situation.

When you would use it

You don't actively try to use a conflict; you encounter one when integrating code, and you must resolve it to complete a merge.

Common operations

  • Resolving colliding code changes during a pull request.
  • Manually fixing a file after rebasing a stale feature branch.

Related terms

Where this is taught

Going deeper