Git python脚本从给定的sha提交id中提取所有后来的提交

问题描述 投票:0回答:1

我试图在特定的开始提交后使用Python从分支中提取所有提交消息的列表。我从GITPython api找不到任何有用的功能,或者我只是错过了它。有人可以指导我吗?

python api gitpython
1个回答
0
投票

您可能想尝试PyDriller,它更容易:

for commit in RepositoryMining("path_to_repo", from_commit="STARTING COMMIT").traverse_commits():
    print(commit.msg)

如果要提交特定分支的提交,请添加参数only_in_branch="BRANCH_NAME"。文件:http://pydriller.readthedocs.io/en/latest/

© www.soinside.com 2019 - 2024. All rights reserved.