Git is very powerful; it lets users to manipulate stuffs which are usually abstracted by high-level user interface. So it's possible to extract subprojects in a git repository by git filter-branch. But there are several pitfalls to achieve this purpose. The following is what you should know to extract subprojects in a git repository:
--index-filter instead of --tree-filter if it's possible.--index-filter is faster than --tree-filter. Because --tree-filter involves working tree while --index-filter deosn't have such overheads. And the overhead easily becomes a big burden even if a project is not so large one (for example, 300 files and 2300 commits).--prune-empty and rebase to level the history.--prune-empty. But --prune-empty keeps merge commits even if the merge commits introduce no change. You can use git rebase {the-root-commit-id} to remove such commits and to level the history as linear one.filter-branch twice; remove unnecessaries first, then rename file/directory structure.git log --pretty=oneline --follow --name-only {file} | grep -v ' ' | sort -u