git filter-repo
A history-rewriting tool for Git, recommended by the Git project itself in place of git filter-branch, that also works as a library for building custom repository-rewriting tools.
git filter-repo rewrites Git repository history, covering the same use cases as git filter-branch but with much better performance and more capabilities, and with a design meant to scale beyond simple rewriting cases. It is now the tool the Git project itself recommends over filter-branch.
Most users run it as a single-file Python script placed on their PATH, using its command-line flags for common rewriting tasks. Because its core logic is a Python module, users with more specialized needs can also import it to build their own custom history-rewriting tools.
It requires Git 2.36 or later and Python 3.6 or later, and its documentation compares it with alternatives such as the BFG Repo-Cleaner and plain filter-branch.