博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

git 统计代码命令

Posted on 2019-09-27 10:57  米粒3  阅读(150)  评论(0编辑  收藏  举报

git log --pretty='%aN' | sort -u | while read name; do echo -en "$name\t"; git log --since="2019-09-01" --before="2019-09-27" --author="$name" --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

 

 

git log --pretty='%aN' | sort -u | while read name; do echo -en "$name\t"; git log --since="2020-03-23" --before="2020-03-27" --author="$name" --pretty=tformat: --numstat | awk '{ add += $1; subs += $2; loc += $1 - $2 } END { printf "新增 %s 行, 移除: %s 行, 总计: %s 行 \n", add, subs, loc }' -; done

 

git log --pretty='%aN' | sort -u | while read name; do echo -en "$name\t"; git log --since="2020-07-01" --before="2020-07-31" --author="$name" --pretty=tformat: --numstat -- . ":(exclude)static" ":(exclude)dist" ":(exclude)src/router" ":(exclude)src/components" | awk '{ add += $1; subs += $2; loc += $1 - $2 } END { printf "新增 %s 行, 移除: %s 行, 总计: %s 行 \n", add, subs, loc }' -; done