Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

List all GitHub repos for an organization - INCLUDING those in teams

Here's my query to the GitHub API

curl -i -u {user} https://api.github.com/orgs/{org}/repos?type=all

But this does not list all repos for this organization that I have access to. Specifically, it does not list repos in the organization that are part of a team that I am a member of.

If I were to query

curl -i -u {user} https://api.github.com/teams/{teamid}/repos

I would see the missing repos. If I were to navigate to github.com, I would see both private organization repos and my team repos next to each other on the same page. Is there a way to get all of these repos in the same API query?

like image 809
user779860 Avatar asked Sep 05 '13 22:09

user779860


People also ask

How do I retrieve all GitHub repositories of an organization?

You can use the github api for this. Hitting https://api.github.com/users/USERNAME/repos will list public repositories for the user USERNAME.

How do I list all repositories in GitHub?

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 see my GitHub Teams?

In the top right corner of GitHub.com, click your profile photo, then click Your organizations. Click the name of your organization. Under your organization name, click Teams.

How do I show my organization on GitHub?

In the top-right corner of GitHub Enterprise Server, click your profile photo, then click Enterprise settings. In the enterprise sidebar, click Policies. Under Policies, click Options. Under "Default organization membership visibility", use the drop-down menu, and click Private or Public.


1 Answers

You can use the below command

gh repo list {organization-name}

before this login with below command

gh auth login

github.com/cli/cli

like image 107
Suraj Singh Rathore Avatar answered Oct 21 '22 08:10

Suraj Singh Rathore