Created
November 29, 2017 05:42
-
-
Save nickcheng/93668b4042c07d4a46f5ad1648f070d6 to your computer and use it in GitHub Desktop.
Remove big file in GIT repo
This file contains hidden or 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
# List the biggest object | |
git rev-list --objects --all | grep "$(git verify-pack -v .git/objects/pack/*.idx | sort -k 3 -n | tail -10 | awk '{print$1}')" | |
# Remove file from git repo | |
# Replace "filepath" to the file's full path | |
git filter-branch --force --index-filter 'git rm -rf --cached --ignore-unmatch filepath' --prune-empty --tag-name-filter cat -- --all | |
# After doing so, remember to push it. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment