Last Updated: September 27, 2021
· rodzyn

Git statistics for repo per author

Get the list of contributors for repository:

git log --format='%aN' | sort -u

Display addition/deletion statistics per author:

git log --shortstat --author="Marcin Olichwirowicz" | grep -E "fil(e|es) changed" | awk '{files+=$1; inserted+=$4; deleted+=$6} END {print "files changed: ", files, "lines inserted: ", inserted, "lines deleted: ", deleted }'

You can filter it by adding --until or --since

git log  --shortstat --author="Marcin Olichwirowicz" --since="1 Jan, 2013" | grep...

If you want just a number of commits, you can use:

git shortlog -sn