I\'ve been following this excellent answer to extract a subdirectory of my git repository into its own repository, while retaining the complete history.
My repositor
Use git-filter-repo This is not part of git as of version 2.25. This requires Python3 (>=3.5) and git 2.22.0
git filter-repo --path src/math --path tests/math
For my repo that contained ~12000 commits git-filter-branch took more than 24 hours and git-filter-repo took less than a minute.