LinuxCommandLibrary

git-guilt

Show change contribution per author

TLDR

Show total blame count

$ git guilt
copy

Calculate the change in blame between two revisions
$ git guilt [first_revision] [last_revision]
copy

Show author emails instead of names
$ git guilt [[-e|--email]]
copy

Ignore whitespace only changes when attributing blame
$ git guilt [[-w|--ignore-whitespace]]
copy

Find blame delta over the last three weeks
$ git guilt 'git log --until "3 weeks ago" --format "%H" [[-n|--max-count]] 1'
copy

Find blame delta over the last three weeks (git 1.8.5+)
$ git guilt @{3.weeks.ago}
copy

SYNOPSIS

git-guilt [options...] [path…]

PARAMETERS

-a AUTHOR, --author AUTHOR
    Stats for specific AUTHOR (name or email pattern)

-p, --percentage
    Show percentages instead of absolute line counts

-e, --email
    Match authors by email instead of name

--since REF
    Consider only commits since REF (tag/branch/commit)

--until REF
    Consider only commits before REF

-h, --help
    Display usage help

DESCRIPTION

git-guilt is a witty command-line tool for Git repositories that calculates and displays the percentage (or count) of code lines authored by a specific developer, using git blame data. Designed with humor in mind, it 'guilts' programmers by revealing how much of the current codebase they own—low numbers prompt self-reflection, high ones spark pride.

It scans tracked files (or specified paths), attributes lines via blame porcelain output, and aggregates stats by author. Blank lines, comments, and generated files can be filtered. Ideal for teams to visualize contributions light-heartedly during standups or retrospectives.

Stats respect Git history, including time ranges via refs. Output includes total lines, authored lines, and percentage. It's a Ruby gem, easy to install, but runs slowly on massive repos due to per-file blames. Not for production metrics—purely fun and insightful.

CAVEATS

git blame-based: ignores deletions, renames, binary files, and uncommitted changes. Slow on large repos. Matches authors via git config, case-sensitive by default.

EXAMPLE OUTPUT

Your lines: 1,247 / 12,593 (9.91%)
John Doe: 4,521 / 12,593 (35.90%)

INSTALLATION

gem install git-guilt
git clone https://github.com/jferris/git-guilt.git

HISTORY

Created by Jeff Ferris in 2011 as a Ruby script for fun code ownership insights. Released as gem 'git-guilt' on RubyGems. Popular in dev communities; last major updates ~2015, still widely forked on GitHub.

SEE ALSO

Copied to clipboard