Git lines of code statistics command

New statistics zhangsan remove the code number of rows in a certain period of time git
git log --author=zhangsan--since=2018-01-01 --until=2019-04-01 --format='%aN' | sort -u | while read name; do echo -en "$name\t"; git log --author="$name" --pretty=tformat: --numstat | grep "\(.html\|.java\|.xml\|.properties\)$" | awk '{ add += $1; subs += $2; loc += $1 - $2 } END { printf "added lines: %s, removed lines: %s, total lines: %s\n", add, subs, loc }' -; done
 
 
Statistics for all lines of code
git log --pretty=tformat: --numstat | awk '{ add += $1; subs += $2; loc += $1 - $2 } END { printf "added lines: %s, removed lines: %s, total lines: %s\n", add, subs, loc }'

Guess you like

Origin www.cnblogs.com/supiaopiao/p/10943882.html