Last active
April 7, 2020 11:31
-
-
Save seabbs/b1f69bd3a2439a7728aad2b7aa5f1450 to your computer and use it in GitHub Desktop.
Clean .rds and .png from git histories using BFG
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!bin/bash | |
## This requires java and bfg to be installed | |
## bfg: https://rtyley.github.io/bfg-repo-cleaner/ | |
## Assumes that the repo is in the current directory | |
## Remove all .rds and .png from the Git history | |
java -jar bfg.jar --delete-files "*.rds" $1 | |
java -jar bfg.jar --delete-files "*.png" $1 | |
## Move into repo and prune to apply changes | |
cd $1 | |
git reflog expire --expire=now --all && git gc --prune=now --aggressive | |
cd .. | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment