PHPackages                             mnapoli/gitstats - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. mnapoli/gitstats

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

mnapoli/gitstats
================

Iterate through git commits to gather statistics

0.1.1(8y ago)10193MITPHPPHP ^7.0

Since Oct 22Pushed 8y ago1 watchersCompare

[ Source](https://github.com/mnapoli/gitstats)[ Packagist](https://packagist.org/packages/mnapoli/gitstats)[ RSS](/packages/mnapoli-gitstats/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (2)Dependencies (4)Versions (3)Used By (0)

Iterate through git commits to gather statistics
================================================

[](#iterate-through-git-commits-to-gather-statistics)

Installation
------------

[](#installation)

- clone this repository
- install Composer dependencies
- symlink the `gitstats` to your `/usr/local/bin`: `ln -s /home//code/gitstats/gitstats /usr/local/bin/gitstats`

Alternatively you can install the Composer package globally (`composer global require mnapoli/gitstats`)

Usage
-----

[](#usage)

- Add a `.gitstats.yml` file in your current directory:

```
tasks:
    'Commit message': "git log -1 --pretty=%B | head -n 1"
    'Commit author': "git log -1 --pretty=%an"
    'Number of files': "find . -type f | wc -l | xargs"
    'Number of directories': "find . -type d | wc -l | xargs"
```

- Run the application:

```
$ gitstats run
```

The repository will be cloned in a temporary directory. All tasks will be run against each commit. Ensure the repository doesn't contain modifications.

The output is formatted as CSV:

```
Commit,Date,Number of files,Number of directories
d612a29fae3b0f625b9be819802e93214d4eecd9,2016-08-31T12:55:38+02:00,61,28
497f22a27896d146a35660f452eba24d3a14db3f,2016-08-31T12:53:01+02:00,61,28
fc0646f236e6bb0a10b14a67424f932f28eb1062,2016-08-26T19:29:40+02:00,62,28
221528e63d7aac3aa247dfde191b5f6c380cbb7e,2016-08-25T01:28:55+02:00,62,28
...
```

You can write the output to a file:

```
$ gitstats run  > results.csv
```

You can then import that into a database or open it up with Excel or whatever.

### MySQL

[](#mysql)

You can output the result as SQL queries to insert/update a MySQL table:

```
$ gitstats run  --format=sql | mysql -u  -p
```

### Limit the number of commits processed

[](#limit-the-number-of-commits-processed)

You can limit the number of commits to process using the `--max` parameter:

```
# Process only 100 commits
$ gitstats run  --max=100
```

### Show the progress

[](#show-the-progress)

You can show a progress bar on stderr using the `--progress` parameter. When using that parameter it makes sense to redirect the output to a file or another command:

```
$ gitstats run  --progress > file.csv
```

[![](https://camo.githubusercontent.com/2acb379d3db7fc36962dc3fa5ef20d0e2807921783621913b7b32514b9136b5a/68747470733a2f2f692e696d6775722e636f6d2f7a6f4b526b65722e706e67)](https://camo.githubusercontent.com/2acb379d3db7fc36962dc3fa5ef20d0e2807921783621913b7b32514b9136b5a/68747470733a2f2f692e696d6775722e636f6d2f7a6f4b526b65722e706e67)

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~79 days

Total

2

Last Release

3047d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/329a6111724074f5388e95dd41a03ccf3c43f4bfe1ecf27c94c9efc6f7823228?d=identicon)[mnapoli](/maintainers/mnapoli)

---

Top Contributors

[![mnapoli](https://avatars.githubusercontent.com/u/720328?v=4)](https://github.com/mnapoli "mnapoli (37 commits)")

---

Tags

gitstatistics

### Embed Badge

![Health badge](/badges/mnapoli-gitstats/health.svg)

```
[![Health](https://phpackages.com/badges/mnapoli-gitstats/health.svg)](https://phpackages.com/packages/mnapoli-gitstats)
```

###  Alternatives

[cognesy/instructor-php

The complete AI toolkit for PHP: unified LLM API, structured outputs, agents, and coding agent control

310107.9k1](/packages/cognesy-instructor-php)[friendsoftypo3/content-blocks

TYPO3 CMS Content Blocks - Content Types API | Define reusable components via YAML

96374.6k23](/packages/friendsoftypo3-content-blocks)[pixelfederation/circuit-breaker-bundle

An analogous bundle to Java's Hystrix in PHP world.

1226.5k](/packages/pixelfederation-circuit-breaker-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
