git统计当前项目代码行数
在项目根目录输入以下代码
git log --format='%aN' | sort -u | while read name; do echo -en "$name\t"; git log --author="$name" --pretty=tformat: --numstat --after="2021-04-01 00:00:00" --before="2021-04-30 00:00:00" | awk '{ add += $1; subs += $2; loc += $1 - $2 } END { printf "added lines: %s, removed lines: %s, total lines: %s\n", add, subs, loc }' -; done