Created
October 6, 2012 16:31
-
-
Save dannyduc/3845387 to your computer and use it in GitHub Desktop.
Remove files from git history
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
Rewrite history | |
git filter-branch -f --index-filter 'git rm -rf --cached --ignore-unmatch target/* .idea/*' --prune-empty -- --all | |
Cleanup and reclaim space | |
rm -rf .git/refs/original/ | |
git reflog expire --expire=now --all | |
git gc --aggressive --prune=now | |
Push to remote repository | |
git push origin master --force | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment