Skip to content

Instantly share code, notes, and snippets.

@dcormier
dcormier / git.md
Last active November 19, 2021 20:55
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.