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 }'

  

posted @ 2021-09-18 13:58  星空异皓`  阅读(512)  评论(0编辑  收藏  举报
/*页脚固定*/