git统计代码行数
  qfTQzbtBS35l 2023年11月05日 39 0

1、统计某段时间内所有人员代码量

git log --format='%aN' | sort -u | while read name; do echo -en "$name\t"; git log --author="$name" --pretty=tformat: --since ==2022-07-30 --until=2022-11-10 --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

2、统计某段时间内某个人的代码量

git log --author="wangqiongying" --since=2022-07-30 --until=2022-11-10 --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 }'

3、统计最近150天内所有人的提交排名降序

git log --all --since=150.day.ago --pretty='%aN' | sort | uniq -c | sort -k1 -n -r

4、统计最近60天内前5个提交者

git log --all --since=60.day.ago --pretty='%aN' | sort | uniq -c | sort -k1 -n -r | head -n 5

5、统计2021/5/1~2021/6/30的提交者排名

git log --format='%aN' --since=2021-05-01 --until=2021-06-30 --all | sort -u | while read name; do echo -en "$name\t"; git log --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

6、统计所有人的提交次数排名

git shortlog --all --numbered --summary --no-merges

 

唯有热爱方能抵御岁月漫长。



【版权声明】本文内容来自摩杜云社区用户原创、第三方投稿、转载,内容版权归原作者所有。本网站的目的在于传递更多信息,不拥有版权,亦不承担相应法律责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@moduyun.com

上一篇: 倒排索引 下一篇: 倒排索引
  1. 分享:
最后一次编辑于 2023年11月08日 0

暂无评论

推荐阅读
qfTQzbtBS35l
作者其他文章 更多