bfg - weakish/cheat GitHub Wiki

[BFG Repo-Cleaner][bfg] is a simpler, faster alternative to git-filter-branch for cleansing bad data out of your Git repository history.

  • Faster : 10 - 720x faster

  • Simpler : The BFG isn't particularily clever, but is focused on making the above tasks easy

    bfg --delete-files id_{dsa,rsa} git reflog expire --expire=now --all git gc --prune=now --aggressive git push --force

BFG assumes that your latest commit is a good one, with none of the dirty files you want removing from your history still in it. This assumption by the BFG protects your work, and gives you peace of mind knowing that the BFG is only changing your repo history, not meddling with the current files of your project.

If something 'bad' (like a 10MB file) is in HEAD, it won't be deleted - it'll persist in your repository, even if the BFG deletes if from earlier commits. If you want the BFG to delete something you need to make sure your current commits are clean.