获取存储库贡献者的姓名以及用户名、电子邮件和指向 github 个人资料的链接

Get names of contributors of a repository along with username, email, and links to github profile

我如何才能获得存储库贡献者的姓名列表(按首次贡献日期排序)以及他们的用户名、电子邮件和指向他们 github 个人资料的链接。 我用了

git log --topo-order --reverse --format="%aN <%aE>" | awk ' !x[[=11=]]++'

但这并没有给我他们 github 个人资料的名称和链接。

But this does not give me the names and links to their github profiles.

没错。

Git 是一个独立的 open-source 项目。它与 GitHub 无关,只是 GitHub 的整个业务模型都基于 Git。这种关系类似于 Git 与 Atlassian(或 Bitbucket,如果您更愿意将 GitHub 视为产品而不是公司)或无数其他公司的关系。

Git 不支持 GitHub 的专有功能,link 也不支持(甚至不知道)GitHub 的用户页面。

如果您想获得 GitHub 存储库贡献者的列表,最好的办法是使用他们的 list contributors API endpoint:

GET /repos/:owner/:repo/contributors

此 returns 一个 JSON 字符串,可供协作者检查。您可能希望将其与其他 API 调用结合使用,例如至 list the commits in a repository.