首页 > 解决方案 > How to list all fork Git URLs via GitHub API?

问题描述

I'd like to list all forks and their URLs of specific GitHub repository programmatically through API. I can't see them all on the page, since it has too many forks to display on the website.

How this can be achieved?

标签: shellcurlgithub-api

解决方案


List of forks can be listed by /repos/:owner/:repo/forks API call.

To list URLs, the following command can help (sorted by stars):

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

Note: Change OWNER and REPO with appropriate values.


推荐阅读