git-range-diff
Compare commit ranges between two branches
TLDR
Diff the changes of two individual commits
Diff the changes of ours and theirs from their common ancestor, e.g. after an interactive rebase
Diff the changes of two commit ranges, e.g. to check whether conflicts have been resolved appropriately when rebasing commits from base1 to base2
SYNOPSIS
git range-diff [options] range1 range2
PARAMETERS
--color[=when]
Color the output. when can be 'always', 'never', or 'auto'.
-w
Ignore whitespace when comparing commits.
--ignore-space-change
Ignore changes in amount of whitespace.
--ignore-all-space
Ignore all whitespace.
--src-prefix=prefix
Specify the source prefix.
--dst-prefix=prefix
Specify the destination prefix.
-p
Show the patch along with the summary.
-u
Show the patch along with the summary.
--patch
Show the patch along with the summary.
--unified=n
Generate diffs with n lines of context instead of the usual three.
range1
The first commit range to compare.
range2
The second commit range to compare.
DESCRIPTION
git-range-diff is a powerful command-line tool used to compare sequences of commits (ranges) between two branches or commit histories.
It essentially shows the differences between two "versions" of a series of commits, highlighting added, removed, modified, or renamed commits within the specified ranges.
This is especially useful when rebasing, cherry-picking, or otherwise manipulating commit history, as it helps understand the impact of these operations.
The output shows a summary of the changes, similar to a diff output, but at the commit level.
It visualizes which commits in the first range have been altered, removed, or added to in the second range.
This command aids in identifying inconsistencies and ensuring that the intended changes are correctly reflected after history manipulation.
COMMIT RANGE SPECIFICATION
The range1 and range2 parameters specify the commit ranges to compare. They can be specified using various notations, such as A..B (all commits reachable from B but not from A), A...B (all commits reachable from either A or B but not from both), or commit^@ (all commits reachable from the given commit, including the commit itself).
EXAMPLE
To compare the commit ranges between branches 'feature' and 'main', you would use the command: git range-diff feature..main main..feature
SEE ALSO
git diff(1), git log(1)