Find out how many lines you contributed to a git repo

Ever wanted to figure out how many lines you added, removed and what your grand-total is?

You can use the following one-liner from inside your repo, to get some stats.

git log --author="_your_git_name_" --pretty=tformat: --numstat | gawk '{ add += $1; subs += $2; loc += $1 - $2 } END { printf "added lines: %s removed lines: %s total lines: %s\n", add, subs, loc }' -

Dont forget to replace _your_git_name_ with your actual git username.

Like this article? Share it!