git range-diff command

Git Basic Operations


git range-diffThe command is used to compare the differences between two commit ranges.

git range-diffThe command is similar to git diff, but allows you to compare two different commit ranges simultaneously, typically used to view changes in a series of commits across different branches or versions. This is especially useful for code review and change comparison.

Basic Syntax

git range-diff <old-range> <new-range>
  • <old-range>: Old commit range or branch.
  • <new-range>: New commit range or branch.

Common usage

1. Compare two commit ranges

Compare the differences between the commit range of branch1 and the commit range of branch2:

git range-diff branch1 branch2

Example:

git range-diff feature/old-branch feature/new-branch

2. Compare two commit series

Compare the differences between two commit series to view changes within a specific time period:

git range-diff <start-old>..<end-old> <start-new>..<end-new>

Example:

git range-diff HEAD~10..HEAD~5 HEAD~5..HEAD

Here, HEAD~10..HEAD~5 represents the old commit range, and HEAD~5..HEAD represents the new commit range.


Git Basic Operations

other extensions