In the GitHub world, what is the container of repositories called? - github

What is the container of repositories called? I can create one of these and then add 1 or more repositories to it.
I checked the GitHub glossary (link below) and it is not clear to me whether or not this is called an "Organization" or "Project".
https://help.github.com/articles/github-glossary/

In the GitHub terminology, a repository belongs either to a user account, or to an organization account.
So the direct answer to your question is "organization".
For example, the repository https://github.com/vuejs/vue.git corresponds to the the vuejs organization that hosts the vue software (that actually corresponds to the Vue.js framework).
As an aside, I usually find myself speaking of a "project" as a synonymous of a Git repository. However, note that the "Projects" keyword mentioned in the GitHub page (cf. the screenshot below) actually refers to a set of Kanban boards.

Related

How to check whether I have a fork of a given GitHub repo?

Let's say there is a repository foo/bar which I forked to me/custom-bar. How do I check programmatically (API call maybe?) given foo/bar that there exists a fork that I own from this upstream? Currently, GitHub has the repos/owner/id/forks API endpoint that returns upto 100 entries if you explicitly mention it. I don't see any parameters for creating a custom query for this particular problem. Counting in the rate-limiting and stuff, I don't think it's possible to know this using this API endpoint if I had say a fork of the linux project where over 20k+ forks exist. Is there any fast and efficient way to know this?
Note: I don't want to use authentication if at all possible.
New option (June 2022), directly on GitHub (instead of locally through API)
The repository fork button now displays existing forks
A dropdown has been added to the Fork button to help you quickly find your forks of a repository. This includes forks in your personal account and in organizations that you're a member of.
This feature was inspired by Refined GitHub – an impressive open source project maintained by #fregante.
The feature was requested of GitHub through the GitHub Stars program.
Read more about forking a repository in the GitHub documentation.
We appreciate feedback on this and other topics in GitHub's public feedback discussions.
As a workaround... you can always try to fork your own repo (POST /repos/:owner/:repo/forks).
As explained in "Is it possible to 'fork a fork' in Github?", that won't be generally possible (for a sigle non-organization account) to do if your own repo is itself a fork.
A solution here will be:
Check your repositories using GET /users/:username/repos
For each repo which fork property is true, GEt repository information using GET /repos/:owner/:repo
Check the parent object in json response (that contains parent folder of fork) and validate if full_name is your foo/bar repo

Documentation versioning for GitHub projects

What is the recommended approach on GitHub to organizing documentation when working on a new version that represents a major rewrite?
In my project pg-promise I rely on jsDoc to generate all the documentation, and then publish it into gh-pages, as one usually does.
And while working on a new version that's a major rewrite and a documentation change, what is the best approach to making the new/unreleased documentation available? -
1. Should I simply create a separate repository just for the sake of publishing updated documentation there?
2. Should I use an external hosting/solution altogether?
3. Is there any GitHub feature that will let me publish more than one documentation version?
Thanks in advance!
This is feasible using Github Actions along with a static site generator (SSG) of your choice such as VuePress, Gatsby, Jekyll etc.
In its simplest form, create a GH action to generate the static site folder of the branch/release, then push the folder to corresponding folder in the branch pointed to by GH pages, say gh-pages. One of the branches/releases should be pushed to root. GitHub Pages Deploy Action can be helpful. Add a dropdown list of versions to your static website pointing to the matching folder.
Example:
GitHub action
dropdown list implemented by Vue component
rendered site powered by GH pages

How do I create a "Revision page" with the GitHub API?

I would like to create a "Revision page" where the people can see on what I've been working using GitHub there's an example about what I mean:
It is supposed to show the commits from my GitHub repository.
A) More information is required
Firstly, could you clarify if it is your intention to
Show the Commit history for a single repository, or
You wish to show your commit activity across multiple repositories
Also:
You wish to have this information displayed on Github, or
You
wish to have this information displayed on an external site.
B) Displaying information on GitHub
If the intention is a combination of 1 and 3, then my first suggestion would be to check the existing functionality of GitHub, which has such a feature built-in.
This can be accessed by navigating to your repository, and simply clicking the Commits button. An example of the results can be found here:
Example GitHub Commit History
C) Displaying information on an external site
As you mention that you have limited experience with PHP, I would certainly start by evaluating GitList:
GitList allows you to browse repositories using your favorite browser,
viewing files under different revisions, commit history and diffs.
GitList is free and open source software, written in PHP, on top of
Silex and the Twig template engine.
If you feel confident that you could create your own solution to display the information in an external web page, then you should begin by familiarising yourself with the GitHub Developer Documentation, and specifically:
List commits on a repository
It is also worth examining the following article and existing GitHub project in order to enhance your knowledge:
How to Use Github’s API with PHP (SitePòint Article with code)
GitHub PHP Client (GitHub Project)
It may be that you can clone one of these projects, strip it down to the features essential for your needs, and customise the UI.

How to show the "Repositories contributed to" on github

One of our team member create a repository and all other team member can push their own work to this repository. It seems that, under the tab "Contributions" there should be two kinds of directory: "Popular repositories" and "Repositories contributed to". I push my work to this repository from the user Interface of Eclipse. But in the home page of my github, directory "Repositories contributed to" was not shown up and all my push history can only be seen in the "Public activity". How can I make "Repositories contributed to" shown up so others can see my contribution to the team work? Thanks a lot!
This is the best workaround I have found so far, not a direct solution but could be used as a workaround:
You can see the contributions you have made to a repo with:
https://github.com/{REPO_OWNER}/{REPO_NAME}/commits?author={USER_ID}
So in your profile, you could put hyperlinks to the repos with that. E.g.,:
Contributed to [Caffe][1] and [OpenCV][2]
[1]: https://github.com/BVLC/caffe/commits?author=gineshidalgo99
[2]: https://github.com/opencv/opencv/commits?author=gineshidalgo99
I found the repositories I've pushed code at https://github.com/settings/repositories
I found the other answers cover the issue partially.
One shows repositories with write access only and the other requires you to know the repositories.
Here's how to find all your contributions step-by-step
Log in to your GitHub account and visit https://github.com/pulls
Filter and remove any organizations (like regular work repository/org) with -user:org-i-do-not-want. Add as many org as you want to filter out.
You can see all the pull requests you have raised
Here's a link:
https://github.com/pulls?q=is%3Apr+author%3A<GitHub Username>

How do I make a readonly mirror of my github repo?

We need to have a read only github repo that mirrors our main branch.
I've noticed castle have managed to do it with their entire collection of repositories.
How would I go about achieving this?
Castleproject is an organization (also mentioned here) in order to restrict write access.
That is why you see read-only addresses on their projects.
That also means it (ie the organization "castleproject") can add users with read-only rights.
As a simple user owning a GitHub repo, you wouldn't have access to that feature.
You need to define an "organization".
I believe this is what you are looking for right here:
http://justcramer.com/2011/05/09/creating-a-one-way-git-server-mirror/