LinuxCommandLibrary

git-fame

Show contribution statistics per file

TLDR

Calculate contributions for the current Git repository

$ git fame
copy

Exclude files/directories that match the specified regex
$ git fame --excl "[regex]"
copy

Calculate contributions made after the specified date
$ git fame --since "[3 weeks ago|2021-05-13]"
copy

Display contributions in the specified format
$ git fame --format [pipe|yaml|json|csv|tsv]
copy

Display contributions per file extension
$ git fame [[-t|--bytype]]
copy

Ignore whitespace changes
$ git fame [[-w|--ignore-whitespace]]
copy

Detect inter-file line moves and copies
$ git fame -C
copy

Detect intra-file line moves and copies
$ git fame -M
copy

SYNOPSIS

git fame [options] [pathspec…]

PARAMETERS

-t, --top <N>
    Limit to top N entries (default: 15)

-c, --commits
    Count commits instead of lines

-a, --authors
    Group by authors (default is files)

-f, --files
    Group by files

-m, --no-merge
    Ignore merge commits in stats

-r, --relative
    Relative blame: count only lines touched in pathspec

-h, --help
    Show help

-V, --version
    Print version

DESCRIPTION

git-fame is a third-party Git tool that provides a repository-wide overview of code authorship by aggregating data from git blame across all files or specified paths.

Instead of per-file line-by-line details, it ranks the top contributors (authors or files) by lines of code authored or commits touched. This helps visualize who owns the most code, spot hotspots, or generate fun leaderboards for teams.

By default, it displays the top 15 authors sorted by line count in a formatted table, including percentages and totals. Options allow customization like commit-based stats, file views, ignoring merges, or relative blaming.

Ideal for code audits, onboarding docs, or contribution analysis in open-source projects. Written in Rust for speed, but may take time on massive repos due to full blame traversal.

CAVEATS

Not a core Git command; install separately. Slow on large repos due to full git blame runs. Requires Git repository context.

INSTALLATION

Linux: cargo install git-fame
Or via package managers like Homebrew/apt if available.

EXAMPLE

git fame --top 5 --authors
Shows top 5 authors by lines: table with name, lines, %.
git fame --commits src/
Limits to src/ dir, commit counts.

HISTORY

Developed by Chris Emerson in Rust, first released in 2018. Popular on GitHub (cgarnier/git-fame fork active), used for quick repo blame summaries in dev teams.

SEE ALSO

Copied to clipboard