Created
April 2, 2018 09:29
-
-
Save pansila/d9d084bf7090b5851bcdceb959a61b0f to your computer and use it in GitHub Desktop.
Remove a file in the git database permanently
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
| git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch FILE_PATH' --prune-empty --tag-name-filter cat -- --all | |
| git push origin master --force | |
| rm -rf .git/refs/original/ | |
| git reflog expire --expire=now --all | |
| git gc --prune=now | |
| git gc --aggressive --prune=now |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment