git log --follow, the gitpython way git log --follow, the gitpython way python python

git log --follow, the gitpython way


For example,

With range time:

g = git.Git("C:/path/to/your/repo") loginfo = g.log('--since=2013-09-01','--author=KIM BASINGER','--pretty=tformat:','--numstat')print loginfo

Output:

3       2       path/in/your/solutions/some_file.cs

You can see the added lines, removed lines and the file with these changes.


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)