Purge big files (and their version history) from a git repository
Alec Jacobson
December 23, 2015
- fork the repo (e.g. using github web interface) and never touch the original again until confident that everything below worked
- clone fork
- cd fork
- git rm all big files
- git commit -m "removed big files"
- bfg --strip-blobs-bigger-than 20K .
- git reflog expire --expire=now --all && git gc --prune=now --aggressive
- git push origin --force master
Verify (e.g. on github website) that both repositories look as expected.