GIT / A CONCEPT NOTE

Merge Conflicts

when two truths collide

~65 sec read

Overview · mechanism
pitfall · examples

01 / THE SHORT VERSION

The idea in a few sentences.

Conflicts happen when two branches modify the same line in a file. Git stops the merge process, marking the conflicted lines in code for you to resolve manually.

02 / FOLLOW THE MECHANISM

How conflict resolution flows

  1. Collision

    runs git merge. Git finds conflicting line changes.

  2. Mark tags

    git writes marker tags (<<<<<<< HEAD and >>>>>>> branch) in files.

  3. Resolution

    developer edits files, deleting markers and keeping target code version.

  4. Complete

    staged files are committed, completing the merge conflict resolution.

04 / COMMAND NOTES

Read the command, then the result.

Inspect the flags and arguments before trying an example. Snippets can need local setup, replacement values, or resources in your own environment.

EXAMPLE 01 · REFERENCE

inspect marked conflict tags in workspace files

git diff

EXAMPLE 02 · REFERENCE

cancel merge process, returning workspace to pre-merge state

git merge --abort

Explore command anatomy in the CLI lab