List all git commits with GitPython =================================== I am getting ready to do some timeseries analysis on a git repo with python, my first step is to figure out a way to list all of the git commits so that I... Date: May 9, 2022 I am getting ready to do some timeseries analysis on a git repo with python, my first step is to figure out a way to list all of the git commits so that I can analyze each one however I want. The GitPython library made this almost trivial once I realized how. ``` python from git import Repo repo = Repo('.') commits = repo.iter_commits() ``` This returns a generator, if you are iterating over them this is likely what you want. ``` python commits # ``` The generator will return `git.Commit` objects with lots of information about each commit such as `hexsha`, `author`, `commited_datetime`, `gpgsig`, and `message`. ``` python next(commits) # ```