2014-09-23 230 views
3

需要一些快速帮助。新手终端用户在这里。试图使用这些指令:https://developer.github.com/v3/repos/statistics/#commit-activity获取特定用户的提交历史记录。通过终端从github访问提交历史记录?

不过,我不知道该怎么做这:

GET /repos/:owner/:repo/stats/contributors 

当我更换了所有者和回购与我使用的具体名称,什么都不会发生,因为我在终端得到这个错误:

-bash: GET: command not found 

这是一个非常敏感的问题,帮助!谢谢!

+1

你需要做一个使用curl的HTTP GET请求。 – SLaks 2014-09-23 02:36:07

+0

我试过了,它没有工作:“curl https://api.github.com/repos/:(u/n here)/ :(资源库在这里)/ stats/contributors” – user3508494 2014-09-23 02:48:09

+0

你得到了什么错误? – SLaks 2014-09-23 02:55:52

回答

2

你可以按照这个curl tutorial using GitHub's API看到你可能注意到了in the comments,在你将如何转化

GET /repos/:owner/:repo/stats/contributors 

“:”不应该被包括在内。

curl --include https://api.github.com/users/caspyin 

通行证用户凭证基本身份验证访问受保护的资源,如一个用户主演学家,或私人信息与他们的个人资料

curl --user "caspyin:PASSWD" https://api.github.com/gists/starred 
curl --user "caspyin:PASSWD" https://api.github.com/users/caspyin 

传递只是用户名没有冒号相关(:)将会提示您输入您的帐户密码。
这避免了在命令行历史

curl --user "caspyin" https://api.github.com/users/caspyin 

在你的情况有自己的密码,由权利人及回购名称更换<owner><reponame>

curl https://api.github.com/repos/<owner>/<reponame>/stats/contributors 
相关问题