Gitflow
🖼️Conflict in a Binary FileMedium+550 XP
Workshop
Scenario reference

Conflict in a Binary File: the situation, step by step

The situation

Designer updated `logo.png` on main while you updated it on `feature-rebrand`. Merge conflict — but Git can't 3-way merge a PNG.

You can't 'edit conflict markers' in a binary. Pick one side wholesale.

Medium · 4 steps · +550 XP

What you will practice

This scenario walks through 4 steps, in order:

  1. 01Merge main to trigger the conflict
  2. 02Pick the feature branch version of the binary
  3. 03Stage the resolution
  4. 04Complete the merge
Reveal the step-by-step commands

Try the terminal first — you learn more by doing. When you want to check yourself, here is the command for each step.

  1. 1. Merge main to trigger the conflict
    git merge main
  2. 2. Pick the feature branch version of the binary
    git checkout --ours assets/logo.png
  3. 3. Stage the resolution
    git add assets/logo.png
  4. 4. Complete the merge
    git commit -m "merge: keep rebrand logo"

Key takeaway

`git checkout --ours` or `--theirs <file>` resolves binary conflicts.