Skip to content

Instantly share code, notes, and snippets.

@ahmedwahdan
Created December 11, 2020 14:24
Show Gist options
  • Save ahmedwahdan/30c0bbdb176e6868ebcd1ab120af3a3d to your computer and use it in GitHub Desktop.
Save ahmedwahdan/30c0bbdb176e6868ebcd1ab120af3a3d to your computer and use it in GitHub Desktop.
Clean git history
Using the latest BFG jar file
https://rtyley.github.io/bfg-repo-cleaner/
https://github.com/rtyley/bfg-repo-cleaner
1- Clean large files size
java -jar bfg-1.13.0.jar -b <size> <repo>
2- Rewrite history
from the repo folder
git reflog expire --expire=now --all && git gc --prune=now --aggressive
3- Push the new history
git push --force
https://stackoverflow.com/questions/53090366/unable-to-push-after-bfg-cleaner
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment