Last active
December 19, 2015 03:18
-
-
Save scollett/5889283 to your computer and use it in GitHub Desktop.
I had to permanently remove a ginormous folder of seed data from the git repository history (moved it outside the project). I combined advice in several posts on removing folders/files till it worked. I'm not sure if you need all those parameters to both the tree and index filter, but it worked. *Note, be careful if you've already pushed to a sh…
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
git filter-branch --prune-empty --tree-filter 'git rm -rf --cached --ignore-unmatch FOLDER_OR_FILES_TO_REMOVE' --tag-name-filter cat -- --all | |
git filter-branch --prune-empty --index-filter 'git rm -rf --cached --ignore-unmatch FOLDER_OR_FILES_TO_REMOVE' --tag-name-filter cat -- --all | |
rm -rf .git/refs/original/ | |
git reflog expire --expire=now --all | |
git gc --aggressive --prune=now |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment