git-filter-repo

Quickly rewrite git repository history (filter branches, remove files)

brewmacoslinux
Try with needOr install directly
Source

About

Quickly rewrite git repository history

Commands

git-filter-repo

Examples

Remove a sensitive file from all commits in repository history$ git filter-repo --path secret.key --invert-paths
Remove a directory and all its history from the repository$ git filter-repo --path node_modules --invert-paths
Replace author name and email across entire git history$ git filter-repo --mailmap mailmap.txt