美文网首页
通过Git log命令统计git commit代码提交统计

通过Git log命令统计git commit代码提交统计

作者: 海边的贝壳林 | 来源:发表于2021-07-14 16:34 被阅读0次

开发人员代码统计,通过git log命令实现,可以指定开始时间、结束时间(起止时间)。

git log --format='%aN' | sort -u | \
  while read name;do
    echo -en "$name\t";
    git log --author="$name" --no-merges --since=2021-03-01 --until=2021-06-31 --pretty=tformat: --numstat  -- . ":(exclude)my-web/node_modules"  ":(exclude)docs" \
    | grep -v "\( => \)" \  # 排除文件移动
    | grep -v ".*html.*" \  # 排除.html文件
    | awk '{ add += $1; subs += $2; loc += $1 - $2 } END { printf "added lines: %s\t removed lines: %s \t total lines: %s \n", add, subs, loc }' -;
  done 

缺点:同一特性,commit多次的(改来改去的)人,代码量会比较高,虽然这部分代码其实是无意义的。

相关文章

网友评论

      本文标题:通过Git log命令统计git commit代码提交统计

      本文链接:https://www.haomeiwen.com/subject/qciypltx.html