Setup and Config
Getting and Creating Projects
Basic Snapshotting
Branching and Merging
Sharing and Updating Projects
Inspection and Comparison
Patching
Debugging
External Systems
Server Admin
Guides
- gitattributes
- Command-line interface conventions
- Everyday Git
- Frequently Asked Questions (FAQ)
- Glossary
- Hooks
- gitignore
- gitmodules
- Revisions
- Submodules
- Tutorial
- Workflows
- All guides...
Administration
Plumbing Commands
-
2.55.0
2026-06-29
- 2.53.0 → 2.54.0 no changes
-
2.52.0
2025-11-17
- 2.48.1 → 2.51.2 no changes
-
2.48.0
2025-01-10
- 2.43.1 → 2.47.3 no changes
-
2.43.0
2023-11-20
- 2.38.1 → 2.42.4 no changes
-
2.38.0
2022-10-02
- 2.31.1 → 2.37.7 no changes
-
2.31.0
2021-03-15
- 2.25.1 → 2.30.9 no changes
-
2.25.0
2020-01-13
- 2.20.1 → 2.24.4 no changes
-
2.20.0
2018-12-09
- 2.19.1 → 2.19.6 no changes
-
2.19.0
2018-09-10
SYNOPSIS
gitrange-diff[--color=[<when>]] [--no-color] [<diff-options>] [--no-dual-color] [--creation-factor=<factor>] [--left-only|--right-only] [--diff-merges=<format>] [--remerge-diff] [--no-notes|--notes[=<ref>]] ( <range1> <range2> | <rev1>...<rev2> | <base> <rev1> <rev2> ) [[--] <path>…]
DESCRIPTION
This command shows the differences between two versions of a patch series, or more generally, two commit ranges (ignoring merge commits).
In the presence of <path> arguments, these commit ranges are limited accordingly.
To that end, it first finds pairs of commits from both commit ranges that correspond with each other. Two commits are said to correspond when the diff between their patches (i.e. the author information, the commit message and the commit diff) is reasonably small compared to the patches' size. See Algorithm below for details.
Finally, the list of matching commits is shown in the order of the second commit range, with unmatched commits being inserted just after all of their ancestors have been shown.
There are three ways to specify the commit ranges:
-
<range1> <range2>: Either commit range can be of the form <base>
..<rev>, <rev>^!or <rev>^-<n>. See SPECIFYING RANGES in gitrevisions[7] for more details. -
<rev1>
...<rev2>. This is equivalent to <rev2>..<rev1> <rev1>..<rev2>. -
<base> <rev1> <rev2>: This is equivalent to <base>
..<rev1> <base>..<rev2>.
OPTIONS
--no-dual-color-
When the commit diffs differ,
gitrange-diffrecreates the original diffs' coloring, and adds outer -/+ diff markers with the background being red/green to make it easier to see e.g. when there was a change in what exact lines were added.Additionally, the commit diff lines that are only present in the first commit range are shown "dimmed" (this can be overridden using the
color.diff.<slot> config setting where <slot> is one ofcontextDimmed,oldDimmedandnewDimmed), and the commit diff lines that are only present in the second commit range are shown in bold (which can be overridden using the config settingscolor.diff.<slot> with <slot> being one ofcontextBold,oldBoldornewBold).This is known to
range-diffas "dual coloring". Use--no-dual-colorto revert to color all lines according to the outer diff markers (and completely ignore the inner diff when it comes to color). --creation-factor=<percent>-
Set the creation/deletion cost fudge factor to <percent>. Defaults to 60. Try a larger value if
gitrange-differroneously considers a large change a total rewrite (deletion of one commit and addition of another), and a smaller one in the reverse case. See the Algorithm section below for an explanation of why this is needed. --left-only-
Suppress commits that are missing from the first specified range (or the "left range" when using the <rev1>
...<rev2> form). --right-only-
Suppress commits that are missing from the second specified range (or the "right range" when using the <rev1>
...<rev2> form). --diff-merges=<format>-
Instead of ignoring merge commits, generate diffs for them using the corresponding
--diff-merges=<format> option of git-log[1], and include them in the comparison.Note: In the common case, the
remergemode will be the most natural one to use, as it shows only the diff on top of what Git’s merge machinery would have produced. In other words, if a merge commit is the result of a non-conflictinggitmerge, theremergemode will represent it with an empty diff. --remerge-diff-
Convenience option, equivalent to
--diff-merges=remerge. --notes[=<ref>]--no-notes-
This flag is passed to the
gitlogprogram (see git-log[1]) that generates the patches. - <range1> <range2>
-
Compare the commits specified by the two ranges, where <range1> is considered an older version of <range2>.
- <rev1>
...<rev2> -
Equivalent to passing <rev2>
..<rev1> and <rev1>..<rev2>. - <base> <rev1> <rev2>
-
Equivalent to passing