git统计代码量
1、git按账户统计增量代码:所有人
git log --since=2021-07-01 --until=2021-10-01 --format='%aN' | sort -u | while read name; do echo -en "$name\t"; git log --author="$name" --since=2021-07-01 --until=2021-10-01 --pretty=tformat: --numstat | grep "\(.html\|.java\|.xml\|.properties\|.js\|.css\)$" | awk '{ add += $1; subs += $2; loc += $1 - $2 } END { printf "added lines: %s, removed lines: %s, total lines: %s\n", add, subs, loc }' -; done
2、统计当前用户
git log --since=2021-07-01 --until=2021-09-30 --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 }'