Git contribution triage and reporting tool
Analyze git history and generate rich, styled reports with commit types, language breakdown, work patterns, PR detection, payment estimation, and more.
- Features
- Requirements
- Installation
- Quick Start
- Usage
- Options
- Output Formats
- Examples
- Author Identity & .mailmap
- Privacy
- How It Works
- Project Structure
- Contributing
- License
- Multi-format output — HTML, JSON, CSV, Markdown, plain text
- Rich HTML report — dark theme, responsive, zero external dependencies
- Date filtering —
--since/--untilfor periodic reports - Author filtering — focus on a single contributor
.mailmapsupport — automatically merges duplicate identities- Commit type analysis — feat/fix/docs/refactor/chore breakdown
- Language detection — top file extensions per author
- PR & revert detection — from merge and revert message patterns
- Work patterns — top weekdays and hours per contributor
- Payment estimation — configurable rate and currency
- Privacy controls —
--anonymizeand--redact-emails - Works on any git host — GitHub, GitLab, Bitbucket, Gitea, local repos
- Bash 4.0 or later (for associative arrays)
- Git 2.x or later
- awk, sed, grep (standard on Linux and macOS)
No Python, Node, or any runtime dependencies.
| Platform | Status |
|---|---|
| Linux (Ubuntu, Debian, Fedora, Arch) | ✅ |
| macOS (Intel & Apple Silicon) | ✅ |
| WSL2 | ✅ |
Note: macOS ships with bash 3.2 by default. Install a newer bash via Homebrew (
brew install bash) before runninggitriage.
git clone https://github.com/yourname/gitriage.git
cd gitriage
chmod +x gitriage.shRun from anywhere:
/path/to/gitriage/gitriage.sh --dir /path/to/repocd gitriage
sudo make installThis installs:
gitriagebinary to/usr/local/bin/- library and CSS to
/usr/local/share/gitriage/
Then run:
gitriage --helpUninstall:
sudo make uninstallecho 'export PATH="$HOME/gitriage:$PATH"' >> ~/.bashrc
source ~/.bashrc
gitriage.sh --help# Run on the current repository with default settings
./gitriage.sh
# Open the generated report
xdg-open report.html # Linux
open report.html # macOS
start report.html # Windows (WSL)That's it. The tool generates report.html and report.css next to the
script, and you're ready to inspect contributor activity.
gitriage [OPTIONS]
| Flag | Description |
|---|---|
-d, --dir <PATH> |
Path to git repository (default: .) |
--since <DATE> |
Only commits after this date (e.g. 2026-01-01) |
--until <DATE> |
Only commits before this date |
--author <NAME> |
Filter to a single author (case-insensitive) |
--include-merges |
Include merge commits (default: excluded) |
| Flag | Description |
|---|---|
-r, --rate <NUMBER> |
Hourly rate (default: 50) |
-c, --currency <LABEL> |
Currency label, e.g. USD, EUR, BTC (default: USD) |
Hours estimation: hours = commits × HOURS_PER_COMMIT (default 3).
Edit HOURS_PER_COMMIT at the top of gitriage.sh to tune the multiplier.
| Flag | Description |
|---|---|
-f, --format <FMT> |
html, json, csv, markdown, text (default: html) |
-o, --output <FILE> |
Output file (default: report.html) |
--css <FILE> |
CSS file path (default: report.css) |
--top-paths <N> |
Top changed paths per author (default: 8) |
--top-commits <N> |
Recent commits per author (default: 15) |
| Flag | Description |
|---|---|
--anonymize |
Hash author names and strip file paths |
--redact-emails |
Remove email addresses from author names |
| Flag | Description |
|---|---|
-h, --help |
Show help |
-v, --version |
Show version |
A styled, responsive, single-page report with:
- Summary stat cards (contributors, commits, lines, PRs, reverts)
- Contribution table (commits, added, deleted, net, files, days)
- Share & payment estimate with distribution bars
- Commit-type and language tags per author
- Work pattern analysis (top weekdays and hours)
- Top changed paths per author
- Recent commits per author
CSS is written to a separate file so you can theme it easily.
Structured output for piping into other tools:
./gitriage.sh --format json | jq '.authors[] | {name, commits, net}'Excel/Google Sheets friendly:
./gitriage.sh --format csv > report.csvPerfect for pull request comments or project docs:
./gitriage.sh --format markdown > CONTRIBUTORS.mdFast terminal-friendly output:
./gitriage.sh --format text./gitriage.sh --since 2026-09-01 --until 2026-09-30./gitriage.sh --author "Jane Doe" --format markdown./gitriage.sh --rate 75 --currency EUR./gitriage.sh -o team-october.html --css team-october.css./gitriage.sh --anonymize -o public-report.html./gitriage.sh --dir ~/projects/other-repo./gitriage.sh \
--since 2026-01-01 \
--until 2026-06-30 \
--author "Jane" \
--rate 100 \
--currency USD \
-o q2-report.html# Total payment across the team
./gitriage.sh -f json | jq '[.authors[].est_payment] | add'
# Sort authors by commits
./gitriage.sh -f json | jq -r '.authors | sort_by(.commits) | reverse[] | "\(.name): \(.commits)"'Git identifies authors by name + email. If the same person commits with different emails (work vs personal), they appear as separate contributors.
To merge them, create a .mailmap file at the repository root:
Jane Doe <jane@work.com> <jane@personal.com>
Jane Doe <jane@work.com> Jane Doe <jane.doe@old.com>
gitriage picks up .mailmap automatically — no flag needed.
Verify your mailmap works:
git shortlog -sne --all | headAfter adding .mailmap, the duplicate entries should collapse into one.
Two flags for sanitizing reports before sharing:
- Replaces author names with
anon-<hash> - Strips email addresses from author strings
- Keeps author names but removes
<email>parts
Use --anonymize for public reports, --redact-emails for internal
reports that shouldn't leak contact info.
- Collect — runs
git logon all branches (excluding merges by default) - Parse — extracts commits, dates, authors, file paths via
git log --numstat - Filter — excludes generated files (lockfiles, coverage, minified, binaries)
- Aggregate — builds per-author maps of commits, lines, files, types, languages
- Estimate — computes share and payment (hours = commits × HOURS_PER_COMMIT)
- Render — writes the chosen output format
Time estimation is approximate. Git does not record time spent — only commit timestamps. The tool assumes
HOURS_PER_COMMIT(default 3) hours of work per commit, which is a rough proxy and can skew if contributors make many small commits or few large ones. Use a time tracker for precise billing.
By default, gitriage excludes these from line counts:
- Lockfiles:
package-lock.json,yarn.lock,pnpm-lock.yaml,uv.lock,poetry.lock - Generated:
requirements.txt,.coverage - Minified:
*.min.js,*.min.css - Binaries and assets:
*.svg,*.png,*.jpg,*.ico,*.woff,*.mmdb,*.pyc
To customize, edit EXCLUDE_REGEX in gitriage.sh.
gitriage/
├── gitriage.sh # Main script — parsing, data collection, CLI
├── gitriage.lib.sh # Output writers (HTML, JSON, CSV, Markdown, text)
├── report.css # Stylesheet for HTML output
├── README.md # This file
├── LICENSE # MIT
├── CHANGELOG.md # Version history
├── CONTRIBUTING.md # Contribution guidelines
├── Makefile # Install / uninstall / lint / test targets
├── .gitignore
├── .editorconfig
└── .github/
└── workflows/
└── shellcheck.yml
After a run on a repository, the following files appear next to the target
repository (not in gitriage/):
report.html # the report
report.css # the stylesheet
Contributions welcome. Please:
- Fork the repository
- Create a feature branch:
git checkout -b feature/my-feature - Run
make lint(requiresshellcheck) - Run
make teston a real repository - Commit with a clear message
- Open a pull request
See CONTRIBUTING.md for full guidelines.
git clone https://github.com/yourname/gitriage.git
cd gitriage
chmod +x gitriage.sh
# Lint
make lint
# Test
make testMIT © 2026 gitriage contributors
If you find this useful, give it a ⭐