Grouping repos on GitHub? [duplicate] - github

This question already has answers here:
Can I arrange repositories into folders on Github?
(8 answers)
Closed 4 years ago.
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?

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
Original answer
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.

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.

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".

Related

Can I make sure no one forks my GitHub repo but still allow the work to be seen by recruiters?

I am now building portfolio to get my first tech job. I would like for any recruiters/potential employers to see my code in case they want to see how I am putting things together but I don't want anyone to be able to fork or copy my work.
How is this possible?
If I have a private GitHub repo does that mean that you can see the repo but just not the inner contents? I have looked at the GitHub documentation already.
If I have a private GitHub repo does that mean that you can see the repo but just not the inner contents?
If you can access a repository (public or private), that means you can read its content and/or clone it (and read its content locally)
You would need to setup a private repository dedicated to show your file
names, meaning a collection of files with:
dummy content
the exact names and folder structure than your actual projects.
That way, you can share to select collaborator access to that "showcase" repository, without compromising the sensitive content of your actual project repositories.

How to track all the upstream issues my fork addressed

My company wants to contribute on opensource projects and managers want an easy way to see which upstream issues were closed by forks from our organization.
Is there any way to maybe copy upstream issues to a fork or reference them in an easy way to track my organization contributions to a project?
This may be possible through GitHub Projects. Projects exist per the organization, not a particular repo. You can also link to issues and pull requests from repos of other organizations by entering user/repo#issue in the project's task description.
In the case of your scenario, suppose your team shares a GitHub organization. You can create project, then add items that reference your issues and pull requests, which exist within the open source project's repo. You can configure and organize your project's view(s) to display the information you want to show. Since this merely links to the issues/PRs from the open source repo, the original stays intact, and how they are displayed in your project stay in sync.

Is there a way to create an alias of reviewers that can be added to a github pull request all at once?

The way we do pull requests at my company, we require 5 specific people to be on all pull requests into Repository A, and a different list of 4 people on all pull requests into Repository B. It's kinda a pain to remember which names go where and not leave anyone out.
Is there a way I can create an alias or something that will autofill in the review request fields that will add all the appropriate people?
For instance, I want to create RepositoryAReviewers and RepositoryBReviewers, and then whenever I pull request to either repository I can just put the alias in the review request field and hit submit. Does this exist?
What you want to do is create teams for these groups. For example, when I wish to merge code at work, I use the my-company/my-team-reviewers team, which pings all of the reviewers on my team. my-company is the name of your GitHub organization.
If you additionally want to require all reviews for a certain repository (or certain files within that repository) to be from a certain team, you can use the CODEOWNERS file to do so. That's especially useful if you have a core team for a project that you always want to do reviews, or if teams are responsible for certain subsystems.
A CODEOWNERS file that affects the entire repository would look like this:
* #my-company/core-dev
I had the same problem last week and made a simple chrome extension to create/save lists of usernames and bulk-add these lists as reviewers on my currently open PR
https://chrome.google.com/webstore/detail/github-reviewer-groups/mmgjipidkhkfimmfgcgklooinlcfonah?hl=en&authuser=0
It's open source too, so feel free to try improving it. The repo is here: https://github.com/KhaledAylii/Github-Reviewer-Groups/tree/master

Is there a way to tag projects in github

Is there a way to tag projects in Github. I would like to group projects based on my interests and I was wondering if there is a tool which allows you to do that on top of Github.
GitHub does not have built in repository tagging. However, GitHub has added language filters and other filters to your stars page, which may help.
If that isn't enough, I recommend creating a markdown document in a new repository and simply listing GitHub repos in separate sections.
You might be interested in my answer to a similar question here: https://stackoverflow.com/a/42049046/5012123
This might be useful if the repositories you are interested in use 'topics' consistently.
If you want to see tags from maintainers of repositories, use GitHub Topics.
If you want to privately maintain your own tags for any repositories, star them and use Astral to organize them.

Mercurial hosting with folders / repository organizing capabilities

I'm currently using Bitbucket for my Mercurial repositories and it's working great. I would however like to be able to organize my repositories in folders, as having them all in one long list is a bit disorganized for my liking.
To be clear I'd like to be able to access my repositories kind of like this:
hg clone https://username#bitbucket.org/username/foldername/reponame
While (AFAIK) it is currently only possible to use a single reponame, no foldername.
Is there any Mercurial hosting provider that does this, or is there some other method that might help me organize my stuff?
I'm aware of subrepos and I might look into that, but it seems like a hackish solution to my problem (also one of the clusters I am working on uses an ancient Mercurial version from way before subrepos were added). Another possibility would be to have multiple user accounts for Bitbucket, but again that doesn't really scale well (I don't want to wind up with 10 accounts).
You will have to use separate repositories.
Kiln has a nice interface that supports multiple repositories.
Organize Your Code
Start simply by just creating the repositories you need for your
code. Kiln introduces branch repositories, repository groups, and
projects to help keep things organized as you develop your own
workflow.
...
Repository Groups and Projects are there to help keep related code
grouped together. Whether your software project is large or small, it
can be really helpful to separate different parts of the code into
different repositories. What used to be accomplished with complicated
naming schemes is now accomplished with simple labels and
drag-and-drop organization.
Kiln (kilnhg.com) has a concept of projects and groups for organizing repositories along with several other really cool features.
It is a commercial product, however. (Your question didn't mention whether or not that was a problem for you.)
The only way you can obtain this using Bitbucket is to create a single repository named "foldername" and put the sub-repository inside this 'root repository'. This however is not the best practice according to the mercurial philosophy. Also, you will have a single bitbucket panel as per a single repository.
You can then use the mercurial feature Suprepositories to manage the whole collection:
https://www.mercurial-scm.org/wiki/Subrepository
Read about the kind of layout you are looking for here:
https://www.mercurial-scm.org/wiki/UnderstandingMercurial
(point 6, at the end of the page)
Of course you can setup your personal mercural server to do this, but is a little bit tricky and I discourage it. If you wanto to try, you can start from here:
http://ekkescorner.wordpress.com/blog-series/git-mercurial/step-by-step-install-mercurial-server-on-ubuntu/