LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

git-fame

Generate contribution statistics by author

TLDR

Show line statistics
$ git fame
copy
Sort by number of commits
$ git fame --sort=commits
copy
Exclude paths (comma-separated or regex)
$ git fame --excl=[vendor/]
copy
Show specific directory
$ git fame [src/]
copy
Show emails instead of names
$ git fame --show-email
copy
Detect moved/copied lines for more accurate attribution
$ git fame -M -C
copy

SYNOPSIS

git fame [options] [gitdir...]

DESCRIPTION

git fame generates contribution statistics showing lines of code, commits, and files per author. It provides a comprehensive view of who contributed what to the codebase, using blame analysis to count current lines attributed to each author.Output includes percentages for relative contribution comparison, and can optionally estimate development cost using the COCOMO model or elapsed commit time. The tool is useful for understanding code ownership patterns and team contribution distribution.

PARAMETERS

GITDIR

Git directory to analyze (default: current directory). May be repeated.
--branch BRANCH
Branch or tag to analyze (default: HEAD).
--sort KEY
Sort by loc (default), commits, files, hours, or months.
--excl PATTERN
Excluded files, comma-separated or regex.
--incl PATTERN
Included files (default: all).
--loc TYPE
Count surviving, insertions, or deletions.
--since DATE, --until DATE
Restrict to commits in a date range.
--cost METHOD
Estimate cost via months, cocomo, hours, or commits.
-e, --show-email
Show author emails instead of names.
-w, --ignore-whitespace
Ignore whitespace-only changes when attributing blame.
-M
Detect intra-file line moves and copies.
-C
Detect inter-file line moves and copies.
-R, --recurse
Recursively find repositories and submodules.
-t, --bytype
Break down stats per file extension.
--format FORMAT
Output format: pipe, md, yaml, json, csv, tsv, or tabulate.
-h, --help
Display help information.

INSTALL

sudo dnf install git-fame
copy
nix profile install nixpkgs#git-fame
copy

CAVEATS

Blame-based counting can be slow on large histories. Binary files are skipped by default (--warn-binary to be notified). Only the current tree's last modifier gets credit unless -M/-C are used to trace moved or copied lines back to their original author.

HISTORY

git fame is a Python rewrite by Casper da Costa-Luis, distinct from the earlier git-fame-rb Ruby gem by Linus Oleander that inspired the name.

SEE ALSO

RESOURCES

Copied to clipboard
Kai