Sometimes you realize a part of your current project (like a library for example) should have it's own repository. Sure, you could simply copy and paste the files into a newly created repository, but you would lose all the previous commit network. Not loosing this network while isolating a part of your porject is the goal of this tutorial.
Let ~root/project
be the absolute path of your project and path/to/subproject
the path to your subproject directory (the directory you want to isolate) relatively to the project path, so that ~root/project/path/to/subproject
is the absolute path of the subproject.
Since we never modify to the actual project until the last step, it's all safe. However, always keep a copy of your project somewhere.
- Isolate the submodule in its own directory.