Skip to main content
>_ supraj.dev
TOPIC GIT
Merge Conflicts when two truths collide
IN 10 SECONDS

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.

GOTCHA Avoid committing merge conflict marker tags (<<<<<<<) in code. Always review your edits with git diff before staging.
HOW CONFLICT RESOLUTION FLOWS
01 Collision runs git merge. Git finds conflicting line changes.
02 Mark tags git writes marker tags (<<<<<<< HEAD and >>>>>>> branch) in files.
03 Resolution developer edits files, deleting markers and keeping target code version.
04 Complete staged files are committed, completing the merge conflict resolution.
POKE IT YOURSELF
git diff — inspect marked conflict tags in workspace files
git merge --abort — cancel merge process, returning workspace to pre-merge state