Skip to content
Latchkey

git range-diff: Usage, Options & Common CI Errors

git range-diff shows how a series of commits changed between two iterations - a diff of diffs.

range-diff is invaluable after a rebase or force-push: it tells you what actually changed between the old and new series.

What it does

git range-diff matches up commits from two ranges and shows how each changed, making it easy to review what a rebase or amended series altered beyond just moving the base.

Common usage

Terminal
git range-diff main..@{u} main..HEAD
git range-diff old-base new-base
git range-diff <base> <old-tip> <new-tip>
git range-diff --creation-factor=80 A...B

Options

Form / flagWhat it does
<r1> <r2>Compare two symmetric ranges
<base> <old> <new>Three-arg form with a common base
--creation-factor=<n>Tune commit pairing heuristic
--no-color-movedDisable moved-line coloring

Common errors in CI

fatal: need two commit ranges - range-diff requires two ranges (or the base/old/new triple). Mis-specifying ranges yields confusing "all commits new" output; ensure both ranges share a base, and that full history is present (not a shallow clone).

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →