我需要遍历整个 repo 的分支提交。我已经尝试过了,但没有成功。:
for branch_name in list(repo.branches.remote):
try:
branch = repo.lookup_branch(branch_name)
ref = repo.lookup_reference(branch.name)
repo.checkout(ref)
for commit in repo.walk(branch.target, pygit2.GIT_SORT_TIME):
print(commit.id.hex)
任何帮助将不胜感激,谢谢。