GIT contribution per author (lines)

前端 未结 2 978
刺人心
刺人心 2020-12-16 02:11

I\'m trying to print the per-line contribution of each author to a Git repository.

For that, I use the following command, adapted from How to count total lines chang

2条回答
  •  北荒
    北荒 (楼主)
    2020-12-16 02:19

    Okay, after more investigation I found this on SO.

    git ls-files -z | xargs -0n1 git blame -w | perl -n -e '/^.*?\((.*?)\s+[\d]{4}/; print $1,"\n"' | sort -f | uniq -c | sort -n  
    

    The answer came with support from Eric Z

    RESULT

        234926 USER 1
         32453 USER 2
       2941234 USER 3
    

提交回复
热议问题