A
A
alexandre1082015-02-11 20:59:33
git
alexandre108, 2015-02-11 20:59:33

Git, submodule how to add to the project correctly?

There is a big project with a bunch of directories. And it was decided to separate some of the directories into different ones in submoduleorder to put githubeach in its own separate repository. But at the same time, I would not want to move and copy anything anywhere.
But in all the examples it is written how to create submodulefrom an existing repository for githubexample: But it is not at all clear how to do the opposite, create from an existing folder . This option produces errors:
git submodule add [email protected]:test test
submodule

mkdir test
git submodule add ./test

And as far as I understand, this is not entirely correct:
mkdir test
git init test
git submodule add ./test

Well, how then, with this option, to say gitwhat exactly submoduleto send to the desired repository is not at all clear.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
DevMan, 2015-02-11
@alexandre108

submodule is a separate repository. Accordingly, before adding it, you need to create it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question