mirror of
https://github.com/ivuorinen/branch-usage-checker.git
synced 2026-02-25 14:52:30 +00:00
d09d1c262f2f235e9561066ec0f5c67d5d86cace
The previous README was minimal (17 lines). Expand it with requirements, installation (Composer + PHAR), usage with example output, development commands, and a CI status badge.
Branch Usage Checker
A CLI tool that cross-references GitHub branches with Packagist download statistics to identify branches safe to delete. Configure a lookback window (default 9 months), review a statistics table of per-branch downloads, and get a suggestion list of zero-download branches you can clean up.
Requirements
- PHP 8.4+
Installation
Composer (global)
composer global require ivuorinen/branch-usage-checker
PHAR
Download the latest branch-usage-checker PHAR from
GitHub Releases, then:
chmod +x branch-usage-checker
./branch-usage-checker check <vendor/package>
Usage
branch-usage-checker check <vendor/package> [months]
| Argument | Description | Default |
|---|---|---|
vendor/package |
Packagist package name | |
months |
Months to look back | 9 |
Example
$ branch-usage-checker check ivuorinen/branch-usage-checker 6
Branch usage statistics for ivuorinen/branch-usage-checker
┌────────────────────┬────────┬────────┬────────┬────────┬────────┬────────┐
│ Branch │ 2025-7 │ 2025-8 │ 2025-9 │ 2025-… │ 2025-… │ 2025-… │
├────────────────────┼────────┼────────┼────────┼────────┼────────┼────────┤
│ dev-master │ 42 │ 38 │ 51 │ 47 │ 55 │ 60 │
│ dev-feat/dto │ 0 │ 0 │ 0 │ 0 │ 0 │ 0 │
│ dev-fix/timeouts │ 3 │ 1 │ 0 │ 0 │ 0 │ 0 │
└────────────────────┴────────┴────────┴────────┴────────┴────────┴────────┘
Suggestions — branches with zero downloads (safe to delete)
┌────────────────────┐
│ Branch │
├────────────────────┤
│ dev-feat/dto │
└────────────────────┘
Development
git clone https://github.com/ivuorinen/branch-usage-checker.git
cd branch-usage-checker
composer install
| Command | Description |
|---|---|
composer test |
Run tests (Pest) |
composer lint |
Check code style (PHPCS, PSR-12) |
composer format |
Auto-fix code style (PHPCBF) |
composer build |
Build PHAR to builds/ |
Pre-commit hooks (CaptainHook) are installed automatically and will run PHPCBF + PHPCS on staged PHP files.
License
MIT — see LICENSE for details.
Languages
PHP
100%