进入项目目录
printf "%25s %10s %10s %10s\n" "用户名" "总行数" "添加行数" "删除行数"
git log --format='%aN' | sort -u -r | while read name; do printf "%25s" "$name"; \
git log --author="$name" --pretty=tformat: --numstat | \
awk '{ add += $1; subs += $2; loc += $1 + $2 } END { printf "%15s %15s %15s \n", loc, add, subs }' \
-; done
printf "\n%25s " "总计:"; git log --pretty=tformat: --numstat | \
awk '{ add += $1; subs += $2; loc += $1 + $2 } END { printf "%15s %15s %15s \n", loc, add, subs }'
标签:loc,15s,git,行数,--,提交,printf,subs
From: https://www.cnblogs.com/bincoding/p/17241360.html