Last active
March 17, 2020 15:08
-
-
Save ksloan/0b0ff3e83acafb09cc8f1c6010badb9c to your computer and use it in GitHub Desktop.
Remove an entire directory from git history
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
git filter-branch --tree-filter "rm -rf FOLDER_NAME" --prune-empty HEAD | |
git for-each-ref --format="%(refname)" refs/original/ | xargs -n 1 git update-ref -d | |
git gc | |
git push origin master --force |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment