As a subset of the question detach-subdirectory already made before and considering the fact that even though a lot of questions were made about the process of splitting and merging git repositories, I couldn't find one that touches the subject of splitting when submodules are present.
So in the following scenario:
.git/
.gitmodules
folder/
data/
content/
other_data/
submoduleA/
submoduleB/
I would like to get two repositories with the following structure:
.git/
data/
and
.git/
.gitmodules
content/
other_data/
submoduleA/
submoduleB/
The first case is not a problem and can be solved easily with the method described in detach-subdirectory.
The second not so much. The existence of submodules and the fact that .gitmodules contains the full path for folder/content/submoduleA
and folder/content/submoduleB
causes part of the history to be inconsistent since .gitmodules refers to a nonexistent directory structure (once filter-branch is used).
So I would like to know if there is a way to do this without causing inconsistent history.