代码之家  ›  专栏  ›  技术社区  ›  Mike

如何总结用户在git repo中添加/删除的行?

  •  5
  • Mike  · 技术社区  · 16 年前

    How to count total lines changed by a specific author in a Git repository? ,它有命令 git log --author="<authorname>" --pretty=tformat: --numstat

    2 回复  |  直到 9 年前
        1
  •  6
  •   jfs    16 年前
    $ git log --author="<authorname>" --pretty=tformat: --numstat | perl -ane'
    > $i += $F[0]; $d += $F[1]; END{ print "added: $i removed: $d\n"}'
    
        2
  •  2
  •   pdbrito    8 年前

    git log --author="<authorname>" --pretty=tformat: --numstat | awk -F" " '{ added += $1; removed += $2 } END { print "added: ",  added, "removed:", removed }'