Gitflow
🐘Accidentally Committed a 500MB BinaryHard+750 XP
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.

Untracking the file stops it growing; the 500MB already in history only goes away with git-filter-repo or BFG, which run outside this browser.

Hard · 5 steps · +750 XP

What you will practice

This scenario walks through 5 steps, in order:

  1. 01Check repo size
  2. 02Stop tracking the artifact (it stays on disk)
  3. 03Commit the removal
  4. 04Garbage collect aggressively
  5. 05Push the fix
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. Stop tracking the artifact (it stays on disk)
    git rm --cached build/app.dmg
  3. 3. Commit the removal
    git commit -m "chore: stop tracking build/app.dmg"
  4. 4. Garbage collect aggressively
    git gc --prune=now --aggressive
  5. 5. Push the fix
    git push origin main

Key takeaway

`git rm --cached` + .gitignore stops the bleeding — every future clone stops re-downloading new copies. The existing blob stays in history until someone runs git-filter-repo or BFG offline. Use Git LFS for binaries and never trust 'I'll delete it later.'