Emi*_*aas 6 github-api pygithub
我需要检查对 github 上特定分支所做的所有提交。
我知道
repo.get_commits()
Run Code Online (Sandbox Code Playgroud)
但这会返回该存储库的所有分支的提交,我猜。我在Commit 类 和Gitcommit 类中都没有找到任何分支属性。
Branch 类中也没有像 .get_commits() 这样的东西
解决这个问题的正确方法是什么?
正如这里所讨论的,这最终应该使用GitHub API List Commits
\nget /repos/{owner}/{repo}/commits\nRun Code Online (Sandbox Code Playgroud)\n使用要列出提交的 sha 或分支名称作为参数。
\nIb PyGitHub,即github.Repository.Repository.get_commits(),与sha \xe2\x80\x93 string是分支的名称。
这将返回github.PaginatedList.PaginatedList一个github.Commit.Commit
| 归档时间: |
|
| 查看次数: |
3179 次 |
| 最近记录: |