git统计项目开发代码量
年终总结了,看一下自己代码量和提交次数吧。
1、年度个人代码量
git log --since="2022-01-01" --before="2022-12-31" --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 }' -
2、年度代码提交量
git log --since="2022-01-01" --before="2022-12-31" --author="username" --oneline | wc -l
参考:
https://www.shuzhiduo.com/A/WpdKlK6nzV/