Here’s the recipe to remove the lib
folder. You can change the file/path matching and also limit the command for range of commits because what it actually does is basically overwriting the history and removing the unwanted files.
git filter-branch --index-filter 'git rm --cached --ignore-unmatch lib/*' --tag-name-filter cat -- --all
git push --force
This will clean the unwanted lib
folder from the repository completely
It will not rewrite the log commits though and the commit messages will still be there.
[This is an update to post on how to remove Pods folder from iOS project]