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

 

posted @ 2019-01-07 15:31  七夜i  阅读(1324)  评论(0编辑  收藏  举报