-->
当前位置:首页 > articles > 正文内容

Luz1个月前 (10-28)articles260

How to get all commits from a given branch with pygithub?

  • Ell 问题:
    • I am trying to get all commit messages from a specific branch form github using
      pyGithub
      in python. When I do
      repo.get_commits()
      it only returns all commits from the master branch. I know there is an existing quesiton similar to this but I could not get an answer from that.
    • gh = Github(token)repo = gh.get_repo(f"{username}/{repo_name}")branches = repo.get_branches()  # gets all the branches within the repo'''This only prints 1 or 2 commit messages.I have a branch with 300+ commits but it only prints 2 of the commit messagesHow can I make it print ALL the commit messages?'''for branch in branches:    print(branch.commit.commit.message)
  • 回答:
返回列表

上一篇:

下一篇:

发表评论

访客

◎欢迎参与讨论,请在这里发表您的看法和观点。