How to force delete a file in git history
Suppose that .DS_Store
is the file you wanted to delete.
You do the following:
brew install bfg
bfg --delete-files ".DS_Store" --no-blob-protection
git reflog expire --expire=now --all && git gc --prune=now --aggressive
git push origin --force