Skip to content

Instantly share code, notes, and snippets.

@tpiekarski
Last active February 27, 2021 21:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tpiekarski/3a6f7cfbcaa80941b27220c5b27748db to your computer and use it in GitHub Desktop.
Save tpiekarski/3a6f7cfbcaa80941b27220c5b27748db to your computer and use it in GitHub Desktop.
Remove accidentally commited big files from GIT
# Get BFG Repo-Cleaner (https://github.com/rtyley/bfg-repo-cleaner)
wget https://repo1.maven.org/maven2/com/madgag/bfg/1.13.2/bfg-1.13.2.jar
# Removing by filesize
java -jar bfg-1.13.2.jar --strip-blobs-bigger-than <MB> <repository>
# Removing by filename
java -jar bfg-1.13.2.jar <filename> <repository>
# Prune reference logs, cleanup and optimize
git reflog expire --expire=now --all && git gc --prune=now --aggressive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment