hypepat

by PAT GAFFNEY

Removing a File from All past Git Commits

I have a tendency not to add .DS_Store to my .gitignore until I’ve already pushed to Github. Every single goddamn time it happens, I have to spend ten minutes googling for the answer.

Well, here be dragons:

git filter-branch --index-filter 'git rm --cached --ignore-unmatch .DS_Store' HEAD

May the git lords have pity on your soul.