Back to top

How to convert a git project into a submodule

Today I started to add extsting git projects into my home git repository as submodules.
I didn't do that from the beginning since git-svn does not support submodules. But I have disconnected from the subversion repository a while ago. So I can use all git features, now.

It is easy:

$ cd path/to/submodule/e.g./ctrlrpanels
$ git remote -v
origin (fetch)
origin (push)
$ cd ..
$ git submodule add -f ctrlrpanels
$ git commit

Ok. You don't need to commit immediately. You add several submodules and commit them together. You can adapt the workflow to your needs.