Created
October 12, 2011 14:36
-
-
Save afanasy/1281380 to your computer and use it in GitHub Desktop.
Ignore .DS_Store and remove it 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
#ignore | |
echo '.DS_Store*' >> .gitignore | |
#remove from history | |
find . -name '.DS_Store*' | while read f; do git filter-branch --index-filter "git rm --cached --ignore-unmatch $f"; rm -rf .git/refs/original; done; | |
#cleanup | |
git gc --prune=now |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment