Grouping repos on GitHub?

Github

Github Problem Overview


Here's the situation: I'm migrating a bunch of repos to github. The repos are currently organized into groups/directories like 'stack', 'websites', 'applications', etc.

There's no way (I've found) to create groups or folders on GitHub for repos, except with organizations, which seems a poor choice. But maybe not? The problem here is that some of the groups are very small, while others are large... with sub-groups, and I'd like to keep all the projects in one root bucket.

So, I'm left with maybe using a naming convention. Like: 'stack-apache', 'website-foo.com', 'application-some-project'. Or just giving up on organizing them in github and let the project pages / website handle the organization.

Re. scale, I'm looking at 20+ repos initially, with new repos added over time at an estimated rate of 2-5 /year for the next few years.

Anyone have experience with this kind of thing?

Github Solutions


Solution 1 - Github

Organisations in my opinion fit a different purpose in Github than grouping repos (although they do serve to group repos). Organisations are more about fine grained control around repo access (thats my understanding).

Bitbucket has introduced the concept of "Projects", with the following hierarchy (with a comparison to Github):

Bitbucket: Team         -> has N -> Projects -> has N -> Repos
Github:    Organisation -> has N                      -> Repos

Bitbucket still allows Repos to not be assigned to an team or project, I am guessing to support older repos that existed before the concept of a project.

To answer the question, no, not directly. There are outstanding requests with Github to add groups, but it doesn't seem likely (at this point in time).

Prefixing works as a so-so solution:

Repo name: [project]__[repo name]

Lets say you have a client "acme" with two repos:

Eg: acme__api Eg: acme__landing

Github's search is quick and inline, so doing a search for acme__ in your repo list will list all repos for the acme__ project.

Update 2020

I'm not sure exactly when, but Github has (somewhat recently) added the concept of projects, which kind of fill the missing gap. I would argue they aren't quite the same as Bitbucket Projects but they are better suited to grouping related repo's in Github than Orgs

enter image description here

Solution 2 - Github

The idea really is to use organizations to group your related repo together. This also makes it easier for your team member to filter their activity feeds to only organizations they're interested into.

This is like that on Github as git is repo based, not file system based like SVN.

Maybe "Organization" is not a very intuitive name, but on alternative Git platform like Gitlab, these divisions are named "group". You should really consider them like that.

Solution 3 - Github

I think, the idea to group repos on the github is that just put a delimiter between items you want to be related to each other. For example, "project1_projectA_projectX", or "project1-projectA-projectX", or even "project1--projectA--projectX".

For myself I prefer the double-dash delimiter as more intuitive for replacement of the slash character delimiter (/) and less usable in a standalone repository name.

Then the list of your planning projects you have to create would be:

  • project1
  • project1--projectA
  • project1--projectA--projectX

As soon as you create a repository with a delimeter (_ or -) in your name, there is won't be an option to set, for example, the repo description or license from the repo title page. You have to handle these from the repository title page after a first push has made. But you can leave it simple, for example, for the projectX it would be something like this: "project1--projectA submodule".

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionzanerockView Question on Stackoverflow
Solution 1 - GithubChrisView Answer on Stackoverflow
Solution 2 - GithubSimon BoudriasView Answer on Stackoverflow
Solution 3 - GithubAndryView Answer on Stackoverflow