This repo is used to test some scripts how to delete a large file from GIT history
- either by using git filter-list
- or, much faster by using the tool BFG
NOTE: this will rewrite the complete history of your repo! Please be sure to have created a valid backup!
-
backup your repo!!!
-
be sure to have backed up your repo!!!!!
-
download delete-largest-file.sh
e.g. curl https://raw.githubusercontent.com/oveits/git-repo-cleaner/master/delete-largest-file.sh
-
goto local repo
e.g. clone to local:
git clone <your-repo> cd <your-repo>
-
apply to your repo: run delete-largest-file.sh --bfd and follow the instructions
../delete-largest-file.sh --bfd
The option --bfd will speed up the process of filtering; especially, if you have many commits in the repo
Before you apply the scripts to you repo, you might want to test the scripts on a copy of the current repo.
Fork this repo https://github.com/oveits/git-repo-cleaner into your own account.
Clone your copy of the repo (replace yourgitaccount below by your git account name)
git clone https://github.com/<yourgitaccount>/git-repo-cleaner
Add and push a large file by:
bash add-large-file.sh
Clean the repo from the largest file found in git history:
bash delete-largest-file.sh --bfd
The -bfg
option will cause the BFG tool to be downloaded for faster processing.
If you wish, you can also test the filter that comes with GIT (will take longer):
bash delete-largest-file.sh