Give credit where it's due -- precise per-author contribution stats that see through squash merges.
A contribution analysis tool that accurately attributes lines of code to individual authors, even across squash-merged pull requests, with support for file exclusion filters.
brew tap mscheltienne/tap
brew install mscheltienne/tap/git-creditcargo install git-creditPre-built binaries for Linux, macOS, and Windows are available on the GitHub Releases page.
git clone https://github.com/mscheltienne/git-credit.git
cd git-credit
cargo install --path .# Analyze the current repository
git-credit
# Analyze a specific repository
git-credit --repo /path/to/repo
# Limit to the last 50 commits
git-credit --rev HEAD~50..HEAD
# Only include commits after a date
git-credit --since 2025-01-01
# Exclude files from stats (repeatable)
git-credit --exclude "*.lock" --exclude "*.generated.*"
# Output as JSON instead of a table
git-credit --format json
# Include bot accounts (dependabot, pre-commit-ci, etc. are excluded by default)
git-credit --bots
# Skip GitHub API lookups (faster, but squash merges are attributed to the merge author
# only)
git-credit --no-githubBot accounts (identified by [bot]@ in their email address) are excluded from
the output by default. Use --bots to include them. When bots are excluded,
the summary line shows how many were filtered.
To attribute squash-merged PRs to individual authors, git-credit needs a GitHub token. It resolves the token in this order:
--tokenflagGITHUB_TOKENenvironment variableGH_TOKENenvironment variablegh auth token(the GitHub CLI)
If no token is found, git-credit runs in --no-github mode automatically
with a warning.
╭──────────────────────────┬───────────────┬─────┬───────┬─────┬───────╮
│ Author ┆ Contributions ┆ PRs ┆ + ┆ - ┆ Total │
╞══════════════════════════╪═══════════════╪═════╪═══════╪═════╪═══════╡
│ Alice <alice@example.com>┆ 12 ┆ 8 ┆ 1,542 ┆ 389 ┆ 1,931 │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌┼╌╌╌╌╌╌╌┼╌╌╌╌╌┼╌╌╌╌╌╌╌┤
│ Bob <bob@example.com> ┆ 8 ┆ 5 ┆ 876 ┆ 201 ┆ 1,077 │
╰──────────────────────────┴───────────────┴─────┴───────┴─────┴───────╯
2 authors (3 bots excluded), 20 commits walked, 13 squash merges expanded
- Rust (MSRV: 1.88)
- pre-commit
- cargo-deny (optional, for dependency auditing)
- cargo-llvm-cov (optional, for coverage)
git clone https://github.com/mscheltienne/git-credit.git
cd git-credit
pre-commit install
cargo buildcargo build # Build
cargo test # Run all tests
cargo clippy # Lint
cargo fmt # Format
cargo deny check # Audit dependencies
cargo llvm-cov # Coverage report