GIT 統計代碼量總結


 

1,查看git上個人代碼量

git log --author="username" --pretty=tformat: --numstat | awk '{ add += $1; subs += $2; loc += $1 - $2 } END { printf "added lines: %s, removed lines: %s, total lines: %s\n", add, subs, loc }' -

2,統計所有成員的增刪行數

git log --format='%aN' | sort -u | while read name; do echo -en "$name\t"; git log --author="$name" --pretty=tformat: --numstat | awk '{ add += $1; subs += $2; loc += $1 - $2 } END { printf "added lines: %s, removed lines: %s, total lines: %s\n", add, subs, loc }' -; done

3,按時間打印所有成員代碼提交

git log --format='%aN' | sort -u | while read name; do echo -en "$name\t"; git log --since ==2020-12-03 --until==2020-12-10  --author="$name" --pretty=tformat: --numstat | awk '{ add += $1; subs += $2; loc += $1 + $2 } END { printf "added lines: %s, removed lines: %s, total lines: %s\n", add, subs, loc }' -; done

4,查看倉庫提交者排名前五

git log --pretty='%aN' | sort | uniq -c | sort -k1 -n -r | head -n 5

5,貢獻者統計:

git log --pretty='%aN' | sort -u | wc -l

6,提交數統計:

git log --oneline | wc -l

 

 
        
 
        

 

 
       


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM