+2 votes
by
There is a big project with lots of directories. And it was agreed that the portion of the directory to highlight in different submoduleto put on githubeach in its own separate repository. But I would not want anything to move or copy.

But in all the examples is written how to create submoduleexisting repository githubfor example:
git submodule add git@github.com:test test
But it is not clear how to do the opposite, to create from already existing folders submodule.
This option gives the error:
mkdir test
git submodule add ./test

А насколько я понимаю так не совсем правильно:
mkdir test
git init test
git submodule add ./test


Ну и как тогда при таком варианте сказать gitчто именно этот submoduleотправлять в нужный репозиторий совсем не понятно.

1 Answer

0 votes
by
 
Best answer
submodule is a private repository. Accordingly, before you add, you need to create it.
...