Let\'s say you have the repository:
myCode/megaProject/moduleA
myCode/megaProject/moduleB
Over time (months), you re-organise the project.
We painted ourselves into a much worse corner, with dozens of projects across dozens of branches, with each project dependent on 1-4 others, and 56k commits total. filter-branch was taking up to 24 hours just to split a single directory off.
I ended up writing a tool in .NET using libgit2sharp and raw file system access to split an arbitrary number of directories per project, and only preserve relevant commits/branches/tags for each project in the new repos. Instead of modifying the source repo, it writes out N other repos with only the configured paths/refs.
You're welcome to see if this suits your needs, modify it, etc. https://github.com/CurseStaff/GitSplit