Search code examples
javagitgithubarchitecturerepository

Multiple projects in one repository GitHub


I have 5 java projects working together. At first I was working alone on these projects. Now someone joined me and we actually need to use GitHub to work efficiently.

  • Project A is let's say the master project it doesn't depend from any others.
  • Project B is depending from project A.
  • Project C is depending from B and A.
  • Project D etc etc.

I'm facing a design problem:

  • Should I use one git repo and put all of them together but in different folders?
  • Should I use different git repo and keep them independant (might be better for commiting)?
  • Should I use different git repo and regroup all of them in a single master git repo?

Solution

  • You should put each of them in its own git repository.

    You then can use git submodules to add depending project to another.

    Example: Project A will contain project B as submodule.

    Read more about git submodules
    Official documentation