赞
踩
本篇博文为转载,转载连接如下:
https://blog.csdn.net/qq_40985985/article/details/109177114
https://blog.csdn.net/qq_41035588/article/details/117921842
git log --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 --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="xxx@xxx.com" --pretty=tformat: --since=2019-07-20 --until=2021-08-03 --numstat | awk '{ add += $1; subs += $2; loc += $1 - $2 } END { printf "added lines: %s, removed lines: %s,total lines: %s\n", add, subs, loc }'
eg:小编入职一年:
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。