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...BOptions
| Form / flag | What 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-moved | Disable 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
git rebase: Usage, Options & Common CI Errorsgit rebase replays commits onto a new base to keep history linear. Reference for -i, --onto, --continue, --ab…
git diff: Usage, Options & Common CI Errorsgit diff shows changes between commits, the index, and the working tree. Reference for --staged, --name-only,…
git log: Usage, Options & Common CI Errorsgit log shows commit history with flexible formatting. Reference for --oneline, --graph, --pretty, ranges, an…
git format-patch: Usage, Options & Common CI Errorsgit format-patch turns commits into mailbox patch files for review or git am. Reference for -N, --stdout, --c…