Skip to content

Instantly share code, notes, and snippets.

@seabbs
Created July 6, 2018 16:29
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 seabbs/693c6e1b705805a121629c76db8eb946 to your computer and use it in GitHub Desktop.
Save seabbs/693c6e1b705805a121629c76db8eb946 to your computer and use it in GitHub Desktop.
Wrapper function to remove large files using BFG. Requires a version number and repo name
#!/bin/bash
cd $repo
git reflog expire --expire=now --all && git gc --prune=now --aggressive
cd ..
java -jar bfg-$(version).jar --strip-blobs-bigger-than 100M $repo
cd $repo
git reflog expire --expire=now --all && git gc --prune=now --aggressive
git push
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment