Git-filter-repo

From wikinotes

A safe(r)/fast(er) tool to rewrite your git history.

Written to replace usage of git filter-branch.


WARNING:

This tool rewrote virtually every commit in the history, making it very difficult to merge. While everything appears good, I don't trust it. I'm using git-patch from the branch instead.


Documentation

github https://github.com/newren/git-filter-repo/
official docs https://htmlpreview.github.io/?https://github.com/newren/git-filter-repo/blob/docs/html/git-filter-repo.html

Install

pacaur -S git-filter-repo

Usage

WARNING:

paths MUST be absolute, or relative from the GIT ROOT

NOTE:

More examples can be found at the bottom of git-filter-repo -h

# NOTE: paths 
git filter-repo --path foo.zip   --invert-paths   # remove 'foo.zip' in cwd from entire git history
git filter-repo --path some/dir/ --invert-paths   # remove some/dir/ in cwd from entire git history (Apparently does not catch children?)