Alexandre M. Savio

Sat 30 December 2017


Remove big files from a git repository


BFG Repo-Cleaner is a tool to “remove large or troublesome blobs” from Git repositories.

Here goes a quick guide on how to remove files larger than 10 MiB.


Download the lastest release from It includes a .jar file which we will use through the command line.

You can use bfg as an alias for java -jar ~/Software/bfg-1.12.16.jar. Meaning that “~/Software/bfg-1.12.16.jar” is wherever you downloaded the .jar file.

alias bfg=java -jar ~/Software/bfg-1.12.16.jar

First step

First you must delete the blobs that you want to delete from the HEAD of your repository, commit, and push.


Clone your repository in mirror mode:

git clone --mirror git://

Run BFG to delete files bigger than 10MiB (see more examples in the project documentation):

bfg --strip-blobs-bigger-than 10M some-big-repo.git

Prune the reference log entries and push:

cd some-big-repo.git
git reflog expire --expire=now --all && git gc --prune=now --aggressive
git push


Go Top