Otaqui.com Blog

Some notes about extracting (or splitting) a folder from a large repository into a git submodule

There is a lot of great information on StackOverflow about splitting git trees into submodules. We followed this guide that suggests copying the repository and then using git-filter-branch .

We are in the situation where we had quite a lot of branches (around 30) that we wanted to maintain, and many of these included commits to the main repository and the directory that we were splitting off. We’ve discovered a few things along the way.