赞
踩
git log --since=2020-05-28 --until=2020-11-28 --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 }'
--author=xxx
| grep "\(.js\|.css\|.html\|.py\)$"
--since=2020-05-28 --until=2020-11-28
git log --format='%aN' | sort -u | while read name; do echo -en "$name\t"; done
该方法配合 git log 让–author="$name" 读取author值,可以按照提交的作者(非手动指定)来显示修改行数(显示行数是本文开头第一个方法)
即
git log --format='%aN' | sort -u | while read name; do echo -en "$name\t"; git log --author="$name" --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 }'; done
统计提交数
git log --oneline | wc -l
git log --stat|perl -ne 'END { print $c } $c += $1 if /(\d+) insertions/'
git log --since=2020-06-01 --until=2020-11-28 --stat|perl -ne 'END { print $c } $c += $1 if /(\d+) insertions/'
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。