Created
August 27, 2018 21:24
-
-
Save digitalcoyote/3fa8e348619a65031f4aacada1964a10 to your computer and use it in GitHub Desktop.
A one-liner for removing a file/folder from a git repo
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 --index-filter "git rm --cached -f -r --ignore-unmatch <file/folder name>" -f --prune-empty -d "<tempDirectory>" -- --all |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You have to use the file/folder names that existed at the time of the commit. If the name changed, it you will need to do both the new and old names