Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting a user's organization repositories in the GitHub API

We are using the GitHub API on Stack Overflow Careers to bring in a user's repositories. We haven't succeeded in bringing in a user's repositories that are part of an organization.

For example, wycats is a contributor to the jQuery project. Yet querying his repositories via the API does not indicate this -- the jQuery repo is owned by the jQuery organization.

What is the API call(s) to learn that wycats is a contributor to the jQuery repository? The correct answer will take the form of a URL(s) which returns a list of organization repositories for a given user name. If it takes more than one call, that's fine.

Thanks!

like image 986
Matt Sherman Avatar asked May 05 '11 20:05

Matt Sherman


People also ask

How do I retrieve all GitHub repositories of an organization?

How To List All Public Repositories Belonging to a User? So, to list all public repos from a user, send a GET request to https://api.github.com/users/<USER-NAME>/repos , replacing with the actual user from whom you want to retrieve the repositories.

How do I access an organization on GitHub?

To access an organization that you're a member of, you must sign in to your personal account. Tip: Only organization owners can see and change the account settings for an organization. In the top right corner of GitHub.com, click your profile photo, then click Your organizations. Click the name of your organization.

How do I clone all repositories of an organization?

(1) Right click inside the folder you want all of the repos to clone to (2) select "Git Bash Here" - Bash window will open (3) Edit the script with your org name, then copy and paste it into the bash window (maybe make sure line endings are unix based, not sure, I did just to be safe). (4) it should start running.

How do I find repositories on GitHub?

Find an existing repo You can find repos in two ways: Type “14ers-git” in the github.com search bar to find the repository.


1 Answers

I think this is what you're looking for.

Checking Organization Membership

/user/show/:user/organizations [GET]

https://github.com/api/v2/json/user/show/wycats/organizations

List all public repositories of any organization

/organizations/:org/public_repositories [GET]

https://github.com/api/v2/json/organizations/jquery/public_repositories

like image 82
Matt Ball Avatar answered Oct 20 '22 15:10

Matt Ball