gpt4 book ai didi

github-api - PyGithub - 如何获取特定分支的所有提交的列表?

转载 作者:行者123 更新时间:2023-12-04 07:40:15 24 4
gpt4 key购买 nike

我需要检查对 github 上特定分支所做的所有提交。
我知道

repo.get_commits() 
但是我猜这会返回该存储库的所有分支的提交。我在 Commit class 中都没有找到任何分支属性也不在 Gitcommit class .
Branch class 中也没有像 .get_commits() 这样的东西
解决这个问题的正确方法是什么?

最佳答案

discussed here ,这应该最终使用 GitHub API List Commits

get /repos/{owner}/{repo}/commits
将要列出提交的 sha 或分支名称作为参数。
Ib PyGitHub,即 github.Repository.Repository.get_commits() , 与 sha – string是分支的名称。
这将返回 github.PaginatedList.PaginatedList github.Commit.Commit

关于github-api - PyGithub - 如何获取特定分支的所有提交的列表?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67519032/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com