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 git@github.com:keinstein/ctrlrpanels.git (fetch)
origin git@github.com:keinstein/ctrlrpanels.git (push)
$ cd ..
$ git submodule add -f git@github.com:keinstein/ctrlrpanels.git 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.

Schlagworte: