git按人和日期統計程式碼量
阿新 • • 發佈:2021-08-03
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 }'
gitlog--author="[email protected]"--since=2019-12-01--until=2019-12-31--pretty=tformat:--numstat|awk'{add+=$1;subs+=$2;loc+=$1+$2}END{printf"addedlines:%s,removedlines:%s,totallines:%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