Sometimes want to count the warehouse, such as the amount of code, contributors and the like.
1 count the number of commits of a person
git log--author= "$ (git config--get user.name)"--oneline | Wc-l
2 counting the amount of someone's code
git log--author= "$ (git config--get user.name)"--pretty=tformat:--numstat | awk ' {adds + = $ subs + = $ + + $ + + $ + $ + $ + + + $-END {printf "added lines:%s removed lines:%s All lines:%s\n", Adds,subs,a LL} '
3 Submission Ranking Top 10
The%an representative displays only the author name of the commit. You can also use%ae, use author email to prevent the occurrence of duplicate names. Then sort by name or email, then count after Uniq, then sort by number in the first column and last 10 records.
git log--pretty=%an | Sort | uniq-c | Sort-k1-n-R | Head-n 10
4 statistics of how many code contributors
Sort-u equals Sort | Uniq
git log--pretty=%an | Sort-u | Wc-l
Original: http://blog.csdn.net/hongchangfirst/article/details/46606707
Author: Hongchangfirst
Hongchangfirst's homepage: http://blog.csdn.net/hongchangfirst
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Three minutes to teach you to learn git (16)-Stats