Skip to content

Instantly share code, notes, and snippets.

@ridingintraffic
Last active November 9, 2018 21:48
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 ridingintraffic/c39e48a8ab1f0983eb0655cfa708848b to your computer and use it in GitHub Desktop.
Save ridingintraffic/c39e48a8ab1f0983eb0655cfa708848b to your computer and use it in GitHub Desktop.
BFG-tldr
# prework assuming macos
# visit for latest version https://rtyley.github.io/bfg-repo-cleaner/
# creates some folders, downloads bfg symlinks it and paths the file to your bash profile
mkdir -p /Users/$(whoami)/.local/bin/
curl -o /Users/$(whoami)/.local/bin/bfg-1.13.0.jar http://repo1.maven.org/maven2/com/madgag/bfg/1.13.0/bfg-1.13.0.jar
chmod +x /Users/$(whoami)/.local/bin/bfg-1.13.0.jar
ln -s /Users/$(whoami)/.local/bin/bfg-1.13.0.jar /Users/$(whoami)/.local/bin/bfg
echo $PATH:/Users/$(whoami)/.local/bin/ >> /Users/$(whoami)/.bash_profile
source /Users/$(whoami)/.bash_profile
#commands
git clone http://github.com/bigfiles.git
cd big_files
git gc
cd ../
java -jar bfg --delete-files <myhugefilename> big_files
cd big_files
git reflog expire --expire=now --all
git gc --prune=now --aggressive
# repo is ready to push
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment