Home > Enterprise >  How to add repo to git with multiple module
How to add repo to git with multiple module

Time:11-30

I discover a little the universe of Git in the integration of Intellij IDEA. I know how to share a project, the commit, etc.

And now I'm looking at a project (empty on IntellijIDEA) but with several modules. And I would like each module to have its own repo on Git.

Explanation:

                          Project A
                              |
                     Module 1 - Module 2
              (Repo Module 1) - (Repo Module 2)

Thanks

Multiple tries on Git but the project is shared (so empty)..

CodePudding user response:

Run the following commands within the Project A repo directory;

git submodule add -b dev <submodule_repo_url>

Use the right set of branch mapping that is necessary from this repo's branch

When there is an update on the module repo, use the following commands to pull changes, commit and push

git submodule update --remote --recursive

Clone Project A in IntelliJ-Idea, It will clone Project A with all the submodules.

  • Related