Which Git commit stats are easy to pull

Jesper Rønn-Jensen picture Jesper Rønn-Jensen · Sep 28, 2009 · Viewed 64.2k times · Source

Previously I have enjoyed TortoiseSvn's ability to generate simple commit stats for a given SVN repository. I wonder what is available in Git and am particularly interested in :

  • Number of commits per user
  • Number of lines changed per user
  • activity over time (for instance aggregated weekly changes)

Any ideas?

Answer

Pat Notz picture Pat Notz · Sep 28, 2009

Actually, git already has a command for this:

git shortlog

in your case, it sounds like you're interested in this form:

git shortlog -sne

See the --help for various options.

You may also be interested in the GitStats project. They have a few examples, including the stats for the Git project. From the GitStat main page:

Here is a list of some statistics generated currently:

  • General statistics: total files, lines, commits, authors.
  • Activity: commits by hour of day, day of week, hour of week, month of year, year and month, and year.
  • Authors: list of authors (name, commits (%), first commit date, last commit date, age), author of month, author of year.
  • Files: file count by date, extensions
  • Lines: Lines of Code by date