小编Sha*_*war的帖子

在 GitPython 中迭代提交黑白 2 个指定提交

import git
repo = git.Repo(repo_dir)
ref_name = 'master'
for commit in repo.iter_commits(rev=ref_name):
     <some code here>
Run Code Online (Sandbox Code Playgroud)

此代码迭代所有提交。我想迭代黑白 2 次提交。就像git log commit1...commit2

我如何使用 GitPython 的 iter_commits() 方法执行相同的操作。

python git loops commit gitpython

6
推荐指数
2
解决办法
3607
查看次数

标签 统计

commit ×1

git ×1

gitpython ×1

loops ×1

python ×1