Created
July 20, 2016 19:32
-
-
Save npyoung/259cd23947acac5d93a7eceb1acab98b to your computer and use it in GitHub Desktop.
The git-filter method of removing a file completely from git history. Remember to `git push --force` if the repo has a remote!
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
#!/usr/bin/env bash | |
FILEPATH=$@ | |
git filter-branch --force --index-filter "git rm --cached --ignore-unmatch $FILEPATH" --prune-empty --tag-name-filter cat -- --all |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment