Created
September 25, 2014 06:29
-
-
Save zhangskills/feebc4fd9394b39bfcdc to your computer and use it in GitHub Desktop.
git相关
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
git log统计功能
仓库提交者排名前 5(如果看全部,去掉 head 管道即可):
git log --pretty='%aN' | sort | uniq -c | sort -k1 -n -r | head -n 5
仓库提交者(邮箱)排名前 5: 这个统计可能不会太准,因为很多人有不同的邮箱,但会使用相同的名字.
git log --pretty=format:%ae | gawk -- '{ ++c[$0]; } END { for(cc in c) printf "%5d %s\n",c[cc],cc; }' | sort -u -n -r | head -n 5
贡献者统计:
git log --pretty='%aN' | sort -u | wc -l
提交数统计:
git log --oneline | wc -l
添加或修改的代码行数:
git log --stat|perl -ne 'END { print $c } $c += $1 if /(\d+) insertions/;'