GitPython列出了受某个提交影响的所有文件

dim*_*s93 7 python gitpython

我使用这个for循环遍历所有提交:

repo = Repo("C:/Users/shiro/Desktop/lucene-solr/")
for commit in list(repo.iter_commits()):
    print commit.files_list  # how to do that ?
Run Code Online (Sandbox Code Playgroud)

如何获取包含受此特定提交影响的文件的列表?

小智 12

试试吧

for commit in list(repo.iter_commits()):
    commit.stats.files
Run Code Online (Sandbox Code Playgroud)