Github API获取特定代码行的作者/提交者

时间:2017-08-03 21:34:43

标签: github github-api

我正在使用Github代码搜索API来搜索给定存储库中的某些文本。响应似乎不包含与匹配的内容,提交的sha / hash或作者/提交者信息相关的任何信息:

https://api.github.com/search/code?q=addClass+repo:jquery/jquery

有没有办法使用Github API在repo中获取给定代码行的作者/提交者?

谢谢!

1 个答案:

答案 0 :(得分:1)

For searching commits we can use the new Commit Search API which is currently available for developers for preview . During the preview period we need to explicitly specify a custom media type in the 'Accept' header. For example your search using this API could be - curl -H 'Accept: application/vnd.github.cloak-preview' \https://api.github.com/search/commits?q=addClass+repo:jquery/jquery . ref: Search Commits