git-filter-repo
Install it
python3 -m pip install --user git-filter-repo
Source: https://superuser.com/questions/1563034/how-do-you-install-git-filter-repo
How to use it?
- cd YOUR_REPOSITORY
- git filter-repo —analyze # analyze big files, you will see the report in .git/filter-repo/analyze/
- git filter-repo —invert-paths —path FILE_NAME1 —path FILE_NAME2
Reference: