3

I have a GitHub organizational issue.

I have the following delimma. I work at a startup and I am trying to figure out the best way to organize our repo structure. Our product ecosystem is comprised of 5 repos (for API, Mobile, and Web). The API component is comprised of 3 repos and is common. However, the repo for the mobile and the web are unique to each of our clients. Since we have 10 clients, that would mean the following:

** Common ***
Common API 1 repo
Common API 2 repo 
Common API 3 repo

*** Client 1 ***
Web client 1 repo
Mobile client 1 repo

*** Client 2 ***
Web client 2 repo
Mobile client 2 repo

and so on for each of the remaining 8 clients. So at the end of the day, this means I will have 3 + (10 * 2) = 23 repos.

Currently everything is just sitting in one client single organization (the name of our company). Is there a neater way to set this up? I've been reading about GitHub teams, but we are a startup and everyone needs access to everything.

Ideally, I'd like something like this:

http://github/organization
Common API 1 repo
Common API 2 repo 
Common API 3 repo

http://github/organization/client1
Web client 1 repo
Mobile client 1 repo

http://github/organization/client2
Web client 2 repo
Mobile client 2 repo

Does this make sense? Can I do this in Git?

I tried asked Github directly, but they just want me to buy the enterprise license. I need real help (sorry don't mean to offend any Github employees).

Help!

  • Since Dec. 2021, you can also consider list of repositories. See [my edited answer below](https://stackoverflow.com/a/56512145/6309). – VonC Dec 09 '21 at 22:47

2 Answers2

3

Update Dec. 2021 comes with a new way to organize your repositories:

Lists are now available as a public beta

Lists level up the starring experience by making it easy to organize and curate your favorite repositories on GitHub.

You can create public lists that appear on your stars page at https://github.com/USERNAME?tab=stars.

Lists are available to everyone except enterprise managed users.

https://i0.wp.com/user-images.githubusercontent.com/6895176/145467599-0b91cecd-872e-4ca1-bc86-16df076da29d.png?ssl=1



Original answer (2019)

As I explained in "Can I arrange repositories into folders on Github?", you don't have the concept of nested organization, so, to group repositories together, you would need:

  • either multiple organizations (with a naming convention, that might be a workaround)
  • or multiple projects (up to 5 repos per projects)

And don't forget you can add outside collaborators which, inside an organization, will have access to only certain repositories.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
0

If what you're asking is whether multiple levels of nesting are allowed on GitHub, no, they're not. All repositories on GitHub are directly under an organization or user. This is pretty typical for Git hosting, mostly because routing URLs properly with multiple levels becomes a complex nightmare.

As you mentioned, it is possible to separate things out if you use an on-premises solution, because there you control the entire server and can split things out into multiple projects or organizations. Choosing multiple organizations on github.com for a small company isn't a good idea because you end up needing to manage users and billing multiple times, which ends up being a hassle (and potentially expensive).

It may be useful, however, to adopt a naming scheme for repositories instead, say, client1-mobile, client2-web, common-api1, and so forth to organize things.

bk2204
  • 64,793
  • 6
  • 84
  • 100