pygithub - Receive all commits of a specific branch

I am using pygithub for analyzing repositories and iterating on all commits of a repository. But how can I extract the corresponding branch for each commit?

commits = repo.get_commits()
for commit in commits:
     # print(commit.branch) ... something in this way

Many thanks for your help!


Relevant tags