Reputation: 61
Is it possible to have a folder structure on git with multiple repos in it?
For example:
<owner>
<folder 1>
<folder 1.1>
<repo>
<folder 1.2>
<repo>
. . .
<folder 2>
<folder 2.1>
<repo>
<folder 2.2>
<repo>
. . .
<folder 3>
<folder 3.1>
<repo>
<folder 3.2>
<repo>
. . .
Upvotes: 1
Views: 1145
Reputation: 20862
You can surely organize your repos into that folder structure and the question is to how to manage them. I wrote a command-line tool gita for this purpose.
It can display the status of all repos, including the edit status, the relation to remote branch, etc. It also batch executes commands from any working directory.
You can also group the repos. For your project structure, you can run
gita add -a <owner>
which will automatically generate hierarchical groups:
owner
: containing all reposowner-folder1
: repos in itowner-folder1-folder1.1
: repos in thereThen gita ll owner
, gita ll owner-folder1
, etc will display the relevant information. gita <command> owner
will batch run the command on repos in the owner group. You can also run any command on any specified repos from any working directory too.
There are other functionalities such as setting context, defining custom commands, etc. Installation is pip3 install -U gita
. You can find more information on github.
Upvotes: 0
Reputation: 63
If you plan to have this structure in your remote repo (gitlab, github) I don’t see any obstacles. The same is good for a local repo.
Basically gitlab allows you to create subgroups (folder1, folder 1.2, ...) and put whatever amount of repositories inside this subgroups as you wish.
In your case:
You don’t need git submodules if I got your question right. Submodules are needed in case if you have to inject one repo inside another as a folder and have its content synchronised.
Upvotes: 0
Reputation: 263
Assuming the owner is also a git repository, then take a look at git submodules. Otherwise, I don’t see why not.
Upvotes: 2