best guide i’ve found to delete a file from git history
Remove a file permanently from git
You use filter-branch to replay the whole history with a filter applied (—filter-tree ‘rm -f file_to_immolate’). Then you remove the original refspec saved by filter-branch (rm -rf ./git/refs/original). Then you run garbage colleciton to remove the objects that are no longer referenced. (git gc)
And suddenly you’re clean.
Also useful if you’ve been mucking about: Repack/Unpack/Prune/etc…
