How to add existing sub repository as a submodule in git?
I have a private codespace
supermodule with submodule
One way to do it is to manually create the .gitmodules
file.
The format is below:
[submodule "path/to/submodule1"]
path = path/to/submodule/1
url = git@github.com:user/submodule1
[submodule "path/to/submodule2"]
path = path/to/submodule/2
url = git@github.com:user/submodule2
Note you'll have to run
git submodule sync
to apply the changes