如何通过 GitHub API 列出所有分支 Git URL?

How to list all fork Git URLs via GitHub API?

我想通过 API 以编程方式列出特定 GitHub 存储库的所有复刻及其 URL。我无法在页面上看到它们,因为它有 too many forks 显示在网站上。

如何实现?

分叉列表可以通过/repos/:owner/:repo/forks API调用列出。

要列出 URL,以下命令可以提供帮助(按星号排序):

curl -sq "https://api.github.com/repos/OWNER/REPO/forks?sort=stargazers" | jq '.[]|.html_url'

注意:用适当的值更改 OWNER 和 REPO。