进入git仓目录后
统计指定作者和时间的:
git log --author="xxx_author_name_xxxx" --since=2023-01-01 --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 }' -;
查看所有人的:
git log --since=2023-01-01 --format='%aN' | sort -u | while read name; do echo -en "$name\t"; git log --author="$name" --since=2023-01-01 --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
标签:loc,git,subs,--,代码,lines,命令,01
From: https://www.cnblogs.com/UFO-blogs/p/17531216.html