Gitflow
🐘Accidentally Committed a 500MB BinaryHard+750 XP
Workshop
Scenario reference

Accidentally Committed a 500MB Binary: the situation, step by step

The situation

Someone committed `build/app.dmg` (500MB) two days ago. Clones now take 8 minutes. Need to nuke it from history without losing real work.

filter-repo strips a path from every commit. Force-push, then everyone re-clones.

Hard · 4 steps · +750 XP

What you will practice

This scenario walks through 4 steps, in order:

  1. 01Check repo size
  2. 02Strip the binary from all history
  3. 03Garbage collect aggressively
  4. 04Force push the slimmed-down history
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. Check repo size
    git count-objects -vH
  2. 2. Strip the binary from all history
    git filter-repo --path build/app.dmg --invert-paths
  3. 3. Garbage collect aggressively
    git gc --prune=now --aggressive
  4. 4. Force push the slimmed-down history
    git push --force-with-lease --all

Key takeaway

Add a .gitignore + use Git LFS for binaries. Never trust 'I'll delete it later.'