Advanced Git
Amanda Crawford-Adamo
Software and Data Engineer
Git Filter-Repo Command
git filter-repo
A tool for rewriting Git repository history quickly and safely.
Purposes
Install git filter-repo using pip
pip install git-filter-repo
Remove secrets.txt from every commit
git filter-repo --path secrets.txt --invert-paths
Filter-Repo Related Filters
--path
: specifies which paths to operate on
--invert-paths
: operate on all paths except the ones specified in --path
Output
Parsed 150 commits
New history written in 0.10 seconds; now repacking/cleaning...
Repacking your repo and cleaning out old unneeded objects
Key Implications
Use cases
Tips
Advanced Git