3
我想知道哪個是使用GitHub API(Rest API v3)從git存儲庫獲取最新提交信息的最佳方式。我怎麼能從GitHub API獲得最後一次提交
選項1:GET /repos/:owner/:repo/commits/master
我可以假設響應對象的「提交」是分支主機的最新提交嗎?
選項2:GET /repos/:owner/:repo/git/commits/5a2ff
或者調用,通過從主服務器獲取HEAD ref獲取sha,然後使用返回的sha獲取提交信息。
感謝您的幫助
我使用Rest API v3 –
爲什麼'/ repos /:owner /:repo/commits /:branch'是最新的提交? –