0

I would like to have a multi module project in GitHub where each sub module can be clones separately. For example.,

my_project
 -- project-1
 -- project-2

So each of those project should have a separate clonable GitHub url and at the same time if I would like to clone the entire repository, I could do so with cloning the top level my_project.

I'm not sure how to do this. I came across submodules and I'm not suite sure if this is the right thing.

All I understand about sub-modules is that I can attach an already existing repository to be part of my other repository. Is this correct? But I want to be able to create new repository from within my top project. Any ideas on where to look at?

Cœur
  • 37,241
  • 25
  • 195
  • 267
joesan
  • 13,963
  • 27
  • 95
  • 232

1 Answers1

0

The first thing that comes to my mind are dependencies (your submodules). Here is how they are used (SO post) and here is how they work internally (git documentation)

For seperate GitHub URLs you would need seperate projects/ repositories wich you couldn´t clone at once (execpt with a script...).

Maybe you could think about hosting your own git server and manage it that you can download every single sub-repo with a specific url and all at once with another url. I think -not tested- you could do this by file structure like you mentioned:

my_project (git repo)
 -- project-1 (git repo)
 -- project-2 (git repo)
creyD
  • 1,972
  • 3
  • 26
  • 55