Quite often it is the case that you\'re writing a project of some kind, and after a while it becomes clear that some component of the project is actually useful as a standal
To isolate a subdirectory into its own repository, use filter-branch on a clone of the original repository:
git clone
cd
git filter-branch --subdirectory-filter 'path/to/your/submodule' --prune-empty -- --all
It's then nothing more than deleting your original directory and adding the submodule to your parent project.