我正在尝试从GitHub上的存储库中检索协作者列表,例如,我正在使用Goit的GitHub API存储库。
在curl中,请求如下:
curl -u "my user" https://api.github.com/repos/google/go-github/collaborators
在密码提示后,我得到以下JSON结果:
{
"message": "Must have push access to view repository collaborators.",
"documentation_url": "https://developer.github.com/v3"
}
如何获得推送权限?我需要自己成为合作者吗?获得一个项目贡献者的列表有点太多了。
答案 0 :(得分:3)
如何获得推送权限?我需要自己成为合作者吗?有点太多了,只需要 一个项目贡献者的列表 。
项目的合作者和贡献者是不同的。
贡献者是指已接受提交的任何人,即项目网页上的公共信息以及运行git log
的公共信息。 You can get project contributors from the Github API without logging in
$ curl -s https://api.github.com/repos/google/go-github/contributors | head -20
[
{
"login": "willnorris",
"id": 1112,
"avatar_url": "https://avatars.githubusercontent.com/u/1112?v=3",
"gravatar_id": "",
"url": "https://api.github.com/users/willnorris",
协作者是Github上的项目管理员,该信息是私有的。