GitHub: How to list all the private repositories that a particular user has forked? - github

When you remove a user from an organization, GitHub warns you that all their forks of the organisation's private repos will be deleted
Removing people from the XX organization will also delete their forks of any private XX-owned repositories.
And GitHub tells you how many private forks the user has but it does not tell you the repo names (even though I have permission to see them!)
It would be useful to see the repos so that I can check that they really have no outstanding, potentially useful, work left on branches (that they have not opened pull-request for).

To do it from the Web U:
Go to the people tab of the organization (https://github.com/orgs/myorg/people).
Filter/find the person.
Click their name; this will take you to https://github.com/orgs/myorg/people/theirusername, which lists all repos they have access to, including repos in the organization and forks the user has made of them.
Filter the list by their username; this will show just the forks.
This requires owner permissions for the organization.

There's a GitHub API to list all the forks. I haven't tested the API but I assume that you will get ONLY the public forks for other users and all the forks if you're the authenticated user.
If you wanted to query this on behalf of other users you can work on a GitHub Integration that would get users' permissions via OAuth and then you could store that information on your side for a whole group of people.
I don't think this is what you were asking for but additionally there's a WEB UI filter for forked repositories, e.g., https://github.com/defunkt?utf8=%E2%9C%93&tab=repositories&q=&type=fork.

Related

Gist in GitHub Enterprise if user left company

My company uses GitHub Enterprise. Some people are creating Gists to share simple codes. I searched, and it is not possible to create "organization gists".
What will happen to those gists if the person who created them leaves the company (and is no longer listed/member of the GitHub Enterprise)?
As outlined in the documentation,
If employees leave the company, you can suspend their GitHub Enterprise Server accounts to open up user licenses in your GitHub Enterprise license while preserving the issues, comments, repositories, gists, and other data they created. Suspended users cannot sign in to your instance, nor can they push or pull code.
The key part of the above quote is "preserving the issues, comments, repositories, gists, and other data." Their Gists remain in GitHub Enterprise Server, even though their owner can no longer access them.
While Gists are git repositories, there is no way to transfer ownership of a Gist. Instead, you can fork and clone Gists or use a technique like this to move the Gist to a regular Git repository.

Listing GitHub repos created by a specific user

Is there a way to list all repositories within an organization, created or contributed to by a specific user?
For concreteness, I am a member of the organization and I am the user in question.
The organization page has a ton of repos listed and I just want to see the ones that I made.

Cannot create an organization-owned private repository when logged in to my personal account on Github Desktop

My personal GitHub account is a member of an organization account which can create private repositories, and of which I am also an owner (but with a different username). I am trying to create a private repo while logged in from GitHub Desktop while logged in to my personal account. However, the private repository option is disabled, even after I choose the organization as the owner, as shown below.
So I have to log in to the organization account before the private option is enabled.
I can create a private repo normally from a browser, however.
Other following operations (e.g. commits) seem to be fine once I get the write permission.
So do I miss a step here? Or is this intentionally disabled in GitHub desktop?
Considering organizations only proposes private repos under a paid plan, maybe your personal account is not associated with a private account, while your other account owner of the organization is.
The web interface might have (on GitHub side) all the information to link the two accounts, but GitHub Desktop might not (locally) have that same information and might lack the API to query it.

Github organization permissions

I have a main repo that students are forking to do their homework. From the student's view of the repo, the list of collaborating teams is small (their individual team and my teacher team). However, from my view (as admin), there is a long list of teams with access. As a result, students are able to see within other students' private repos.
What is the correct way to manage this so that teams can fork a main repo, and limit access to that repo among teams.

How to know who is the maintainer of a GitHub repository?

Is there a way to know which people have merge privileges on a public GitHub repository. If the owner is a user and not an organization, then at least I know one maintainer, but it's possible that there are other users with merge rights. Also, if the owner is an organization it is possible, that not all members of the organization have merge rights. So is there a way to find the exact maintainers?
Team privileges are not public in general. Even an organization-membership is not public since the publicity must be chosen by the given member, as the Documentation states:
,,By default, your organization membership visibility is set to private. You can choose to publicize individual organization memberships on your profile."
This partly applies for their implementation of CODEOWNERS, too. If it is up to date the given source file is annotated with a link to its responsible GitHub user.
However there's normally no need to know the individual maintainers of a repository (since every interaction with repos you're able to access is covered by the GitHub UI, which also assures that somebody takes care about your request). If your attention is about a public repository you might search the commits for accepted pull-request. But in that case you would preferably fork the repo and just generate pull-requests on your own.
You are even not able to contact an organization via GitHub - try to find their official website, contact them and ask for their maintainers if you need that information.
GitHub (since July 2017) now officially supports "code owners" for projects. Code owners are individuals or teams that are responsible for code in a repository.
Project maintainers can add a CODEOWNERS file to their repository to make it easier for others to identify code owners and have code owners be notified to review Issues and Pull Requests.
See the announcement post and help article for more info.
Just go to the team members tab within your repo, on the right it will describe what type of member they are. Ex: member or owner.