cli / cli/cli

List forks for all users in an org

Open
#7,975 1 comment 0 reactions 0 assignees View on GitHub
core enhancement gh-repo
Dominant language
Go
Stars
46.3k
Forks
9k
Avg merge
2d 9h
Merged PRs (30d)
89

Description

### Describe the feature or problem you’d like to solve

I am working with a customer who would like to be able to list all forks for an organization (including any forks owned by the organization itself, as well as those owned by organization members). Originally, they were under the assumption the `gh repo list --fork` command would list all forks of repositories in the organization (including those owned by users and the organization itself). This is not the case currently, but it would be helpful to be able to pull this information using the GitHub CLI.

As a workaround, I have provided the following:

```bash
gh api /repos/{owner}/{repo}/forks | jq -r '.[] | .full_name'
```

I can see where this would become confusing and potentially unwieldy, given that a user can be a member of any number of organizations. The original request was with regards to enterprise managed user (EMU) accounts, which have membership restricted to organization(s) in their enterprise. I wonder if it instead makes sense to investigate enterprise-specific commands for this type of scenario?

### Proposed solution

Creation of CLI command(s) for enterprise administrators that allow them to list/query repositories and forks owned by all organizations and members within their enterprise.

### Additional context

Add any other context like screenshots or mockups are helpful, if applicable.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.