Fork me on GitHub

Clean your git repo with BFG Repo-Cleaner post

Use case : delete the medias from my git repo that contains huge files.

Download bgf.jar from https://rtyley.github.io/bfg-repo-cleaner/

git clone --mirror https://git.mycompany.com/myrepo.git

java -jar ../bfg-1.13.0.jar --delete-folders medias myrepo.git

cd myrepo.git

git reflog expire --expire=now --all && git gc --prune=now --aggressive

git push

Size 400Mo -> 30 Mo

Categories: linux, linux basics