【发布时间】:2021-11-01 07:27:04
【问题描述】:
使用 pygithub 如何获取 repo 中特定分支的最新提交 相当于 github rest api https://{github.com}/api/v3/repos/{repo/}/{org}/commits/{branch}?per_page=1 我按照中提到的步骤 pygithub - Receive all commits of a specific branch ,返回null。
branches = repo.get_branches() for branch in branches: print(branch.name) commits = repo.get_commits(path="tree/"+branch.name) for commit in commits: print(commit)
【问题讨论】:
标签: commit git-branch pygithub