使用git统计项目代码量

计算代码总行数:

find . -name "*.java" -or -name "*.dart"  |xargs grep -v "^$"|wc -l

计算提交代码数:


git log --author="userName" --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="userName" --pretty=tformat: --since ==2019-7-20 --until=2019-8-3 --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)