Created
February 5, 2013 08:08
-
-
Save ipoddubny/4713009 to your computer and use it in GitHub Desktop.
Rewriting history with git filter-branch
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
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | |
# !!! Don't forget to backup first !!! | |
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | |
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | |
# !!! Everyone who has forked from your repository will need to start over !!! | |
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | |
# removing .settings folder and .project file | |
git filter-branch --index-filter 'git ls-files -- .settings .project | xargs git update-index --remove' --tag-name-filter cat --prune-empty -f -- --all | |
# cleaning up history from bad commits with CRLF files | |
git filter-branch --tree-filter "find . -type f | xargs dos2unix -q" --tag-name-filter cat --prune-empty -f -- --all | |
# pushing it back | |
git push --force --all origin | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment