2014-09-23 227 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 
相關問題