The solution in this answer worked perfectly for me:
You can also test your clean process with a tool like bfg repo
cleaner, as in this answer:java -jar bfg.jar --delete-files *.{jpg,png,mp4,m4v,ogv,webm} ${bare-repo-dir};
(Except BFG makes sure it doesn’t delete anything in your latest
commit, so you need to remove those files in the current index and
make a “clean” commit. All other previous commits will be cleaned by
BFG)