git-obliterate
Remove file from entire history
TLDR
SYNOPSIS
git obliterate filename... [-- rev-list-args]
DESCRIPTION
git obliterate completely removes one or more files from Git history. This git-extras command runs `git filter-branch --index-filter 'git rm -r --cached <files> --ignore-unmatch' --prune-empty --tag-name-filter cat` over `--all` refs (or over a revision range given after `--`), erasing the files from every rewritten commit while keeping tags pointed at their (now rewritten) commits.It is useful for removing accidentally committed secrets, credentials, or large files that should never have been tracked. It does not repack the repository afterward; old objects remain until you run garbage collection.
INSTALL
CAVEATS
This rewrites history and changes all commit hashes. Coordinate with collaborators before using on shared branches. Run `git reflog expire --expire=now --all && git gc --prune=now --aggressive` afterward to actually reclaim disk space and drop the old blobs.
SEE ALSO
git-filter-branch(1), git-gc(1), git-extras(1)
