- 统计项目内所有代码行数
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 }'
输出结果: added lines: 165091, removed lines: 40765, total lines: 124326 - 统计项目内指定时间的代码行数
git log --since=2022-01-01 --until==2022-12-30 --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 }'
输出结果: added lines: 66901, removed lines: 19314, total lines: 47587 - 统计项目内指定时间指定作者的代码行数
git log --since==2022-12-29 --until==2022-12-30 --author="irving" --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 }'
输出结果: added lines: 26, removed lines: 20, total lines: 6
标签:
git
本文转载自: https://blog.csdn.net/qq_42445719/article/details/128498676
版权归原作者 Irving Lu 所有, 如有侵权,请联系我们删除。
版权归原作者 Irving Lu 所有, 如有侵权,请联系我们删除。