Skip to content

Instantly share code, notes, and snippets.

@dcormier
Last active November 19, 2021 20:55
Show Gist options
  • Save dcormier/c1e9b83b1033c3f1632ebc1be218a758 to your computer and use it in GitHub Desktop.
Save dcormier/c1e9b83b1033c3f1632ebc1be218a758 to your computer and use it in GitHub Desktop.
Get handy stats from a git repo
  • Show the first commit: git log --reverse --max-count=1
  • Non-merge commits to master: git rev-list --no-merges master --count
  • Number of non-merge commits in master per author: git shortlog -s -n --no-merges master
  • Merges to master: git rev-list --merges --first-parent master --count

If you want to see the commits in question, you can replace --count with something like --pretty=oneline.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment