Created
June 6, 2017 19:57
-
-
Save brianloveswords/29df2fc0f68ce96f42b85eadf8673b70 to your computer and use it in GitHub Desktop.
Obliterate a file from your 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
#!/usr/bin/env bash | |
file="$1" | |
test -z "$file" && echo "file required." 1>&2 && exit 1 | |
git filter-branch -f --index-filter "git rm -r --cached '$file' --ignore-unmatch" --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