git log --follow, the gitpython way

后端 未结 3 1317
孤独总比滥情好
孤独总比滥情好 2021-02-01 02:19

I am trying to access the commit history of a single file as in:

git log --follow -- 

I have to use gitpython, so what I am doi

3条回答
  •  逝去的感伤
    2021-02-01 02:57

    I'd suggest you to use PyDriller instead (it uses GitPython internally). Much easier to use:

    for commit in RepositoryMining("path_to_repo", filepath="here_the_file").traverse_commits():
        # here you have the commit object
        print(commit.hash)
    

提交回复
热议问题