其他分享
首页 > 其他分享> > git按人和日期统计代码量

git按人和日期统计代码量

作者:互联网

1、统计本人2021-08-02到2021-08-03之间提交的代码行数  (不含8月2号) git log --author="coco" --since=2021-08-02 --until=2021-08-03 --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 --author="liuss@travelsky.com" --since=2019-12-01 --until=2019-12-31 --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 base_branch..obj_branch (--author="提交者") --pretty=tformat: --numstat | grep 文件名/目录名 | gawk '{ add += $1 ; subs += $2 ; loc += $1 + $2 } END { printf "added lines: %s removed lines : %s total lines: %s\n",add,subs,loc }'     git log --author="coco" --since=2020-01-01 --until=2020-01-31 --pretty=tformat: --numstat | grep ./gbsInterfaceTest/src/test/java/rdstd/gpnr/test| gawk '{ add += $1 ; subs += $2 ; loc += $1 + $2 } END { printf "added lines: %s removed lines : %s total lines: %s\n",add,subs,loc }'   git log --author="coco" --since=2020-06-27 --until=2020-06-29 --pretty=tformat: --numstat | grep ./ubsInterfaceTest/src/test/java/rdstd/ubs/test/dcs/AQQ/* | gawk '{ add += $1 ; subs += $2 ; loc += $1 + $2 } END { printf "added lines: %s removed lines : %s total lines: %s\n",add,subs,loc }'       统计junit项目Java代码总行数 1、进入项目目录下 2、右击-----git bash here find . "(" -name "*.java" ")" -print | xargs wc -l   0            

标签:loc,git,subs,--,代码,lines,add,按人
来源: https://www.cnblogs.com/coco9821/p/15095068.html