指定时间代码统计
用法
13 - 17 号 代码情况 近一周
git log --since='2023-11-13 00:00:00' --until='2023-11-17 23:00:00' --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: 4157, removed lines: 1361,total lines: 2796
16 号代码情况
git log --since='2023-11-16 00:00:00' --until='2023-11-16 23:00:00' --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: 547, removed lines: 290, total lines: 257
所有代码情况
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: 262700, removed lines: 65434, total lines: 197266
统计一个人的代码情况
git log --author=xzj --since='2023-11-01 00:00:00' --until='2023-11-17 23:00:00' --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 }'