Bash

List Authors by Commit Count

admin by @admin ADMIN
3d ago
May 31, 2026
Public
0 0 up · 0 down Sign in to vote
Quick repo stats: who has done what. Add --no-merges if you don't want to count merge commits.
Bash
Raw
# Commits per author, all-time
git shortlog -sn --no-merges

# Same, but restrict to a date range
git shortlog -sn --no-merges --since="1 year ago"

# Lines added + removed per author
git log --pretty=tformat: --numstat --no-merges \
    | awk '/^[0-9]+\t[0-9]+/ {add+=$1; del+=$2} END {printf "+%d / -%d\n", add, del}'

# Per-author lines added/removed (slower)
git log --pretty='format:%an' --numstat --no-merges \
    | awk '/^[^0-9]/ {a=$0; next} /^[0-9]+\t[0-9]+/ {add[a]+=$1; del[a]+=$2}
           END {for (n in add) printf "%-25s +%6d  -%6d\n", n, add[n], del[n]}'
Tags

Save your own code snippets

Create a free account and build your private vault. Share publicly whenever you want.