【发布时间】:2019-07-30 15:24:10
【问题描述】:
想要从不同的分支而不是主分支获取提交。它列出了来自 master 分支的提交。我的 Repo master 和测试中有 2 个分支,我想要来自测试分支而不是 master 的提交。
我已经尝试过以下方法从 github repo 获取列表,但它提供了 master 分支的提交
github_commits = repo.get_commits()
我尝试过的完整代码:
from github import Github
g = Github(base_url="https://my_hostnaame/api/v3",
login_or_token="my_access_token")
org = g.get_organization("my_org")
repo = org.get_repo("my_repo_name")
github_commits = repo.get_commits()
print(github_commits)
【问题讨论】: