Created
February 22, 2016 04:48
-
-
Save vraravam/bd1373abeaee41b422ed to your computer and use it in GitHub Desktop.
Git commands to remove specific files from history
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
To find the blobs taking up the max space: | |
git rev-list --objects --all | grep "$(git verify-pack -v .git/objects/pack/*.idx | sort -k 3 -n | tail -100 | awk '{print$1}')" | |
To delete blobs from history: | |
git filter-branch -f --prune-empty --index-filter 'git rm -rf --cached --ignore-unmatch node_modules/* plugins/* platforms/* resources/ios/* resources/android/*' --tag-name-filter cat -- --all | |
git filter-branch -f --prune-empty --index-filter 'git rm -rf --cached --ignore-unmatch public/assets/*' --tag-name-filter cat -- --all | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment