GitStats - Git 项目历史统计信息工具
GitStats - Git 项目历史统计信息工具
功能介绍以及页面介绍
- 该仓库的代码谁提交的代码最多
- 该仓库的活跃度是什么样子的
- 各个时段的提交分析数据
- 每个版本的贡献排名情况
- 每周/每月/每年的贡献排名等等
Linux使用(推荐使用)
如果有 Linux,推荐在 Linux 上下载和安装。我曾尝试用 Windows 来准备环境,要下载 Python2,配置 Cygwin,还要手动配置 Gnuplot (Gnuplot 是一个可移植的命令行驱动的图形工具),挺麻烦的。以下是我在 Linux 上来的安装和使用步骤。
# 下载 Python 2
sudo yum -y install python27
# 安装 Gnuplot
sudo yum -y install gnuplot
# 下载 gitstats
git clone https://github.com/hoxu/gitstats.git
# 下载你要分析的代码仓库
git clone https://github.com/alibaba/fastjson.git
# 执行命令,生产报告
cd gitstats
./gitstats ../fastjson ../html/fastjson
# 开始打印
Output path: /root/html/api_ma
Git path: ../api_management_distributor/
Collecting data...
[0.01299] >> git shortlog -s HEAD | wc -l
[0.00298] >> git show-ref --tags
[0.00353] >> git log "58314e061c62e7166c498390eb7fd74c444658d6" --pretty=format:"%at %aN" -n 1
[0.00394] >> git log "b127e5d8dac35c440ac383af8da96286cc829863" --pretty=format:"%at %aN" -n 1
[0.00287] >> git log "c92e16867b0151ef61571ecf2ca6664c13b5c939" --pretty=format:"%at %aN" -n 1
[0.00435] >> git log "97986fc1d77602285571768cc8f6657aa8dd9b8a" --pretty=format:"%at %aN" -n 1
[0.00331] >> git log "25e68bb77d280bbbe8cfafe0a7dc8d66af3ad32b" --pretty=format:"%at %aN" -n 1
[0.00314] >> git log "b016f537ddc10f3bdedfb2f5c8a225b3540cfce0" --pretty=format:"%at %aN" -n 1
[0.00392] >> git log "b28d153cef79b7de1f23a199a03a6e6122659133" --pretty=format:"%at %aN" -n 1
[0.00319] >> git log "0bbe4a670492d2a36de3d28a0b51ba0c59444ab4" --pretty=format:"%at %aN" -n 1
[0.00433] >> git log "540a0acb6d0eb86a5a0b92c38b84a851b2e88707" --pretty=format:"%at %aN" -n 1
...
...
Execution time 12.85609 secs, 2.13662 secs (16.62 %) in external commands)
You may now run:
sensible-browser '/root/html/api_ma/index.html'
最后将分析结果输出到 /root/html/api_ma/index.html 目录下可以下载下来观看