git倉庫按時間、成員等維度分析統計


git 按時間打印所有成員代碼提交:

git log --since ==2018-01-01 --until=2018-12-31 --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

  

單個成員查詢:

git log --since=2018-01-01 --until=2018-12-31 --author="DENA\chuanyong.zhu" --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 }' -

  

以上是git命令,以下介紹一下gitstats

1.example

2.安裝

a.安裝gitstats
git clone git://github.com/hoxu/gitstats.git

b.安裝brew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

c.安裝gnuplot畫圖程序
brew install gnuplot

d.運行命令
cd xxx/gitstats
python gitstats Documents/gitxxx Documents/gitoutput

xxx/gitstats         為gitstats的本地clone地址
Documents/gitxxx     為本地代碼倉庫路徑
Documents/gitoutput  為生成報表位置

  

 更多:

 https://segmentfault.com/a/1190000008542123

 


免責聲明!

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



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