git 代码统计指北

指定作者的提交统计

git log --since="2025-11-02" --until="2025-11-05 23:59:59" --author="你的名字" --shortstat --oneline

贡献者排行榜

git log --since="2025-11-02" --until="2025-11-05 23:59:59" --all --format='%aN' | sort | uniq -c | sort -rn

时间段内的总体代码变更量

git diff --shortstat $(git log --since="2025-11-02" --until="2025-11-05 23:59:59" --format=%H | tail -1)^ HEAD

时间段内所有人的代码行数统计

git log --since="2025-11-02" --until="2025-11-05 23:59:59" --numstat --pretty=tformat: | awk '{add+=$1; del+=$2} END {print "新增行数:", add, "\n删除行数:", del, "\n净增加:", add-del}'

指定作者的代码行数统计

git log --since="2025-11-02" --until="2025-11-05 23:59:59" --author="你的名字" --pretty=format: --numstat | awk '{add+=$1; del+=$2} END {print "新增行数:", add, "\n删除行数:", del, "\n净增加:", add-del}'

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容