Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

git range-diff command

git range-diff command

Git Basic OperationsGit Basic Operations


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

git range-diff The command is similar to git diff, but allows you to compare two different commit ranges at the same time. It is typically used to view the changes in a series of commits across different branches or versions. This is particularly useful for code review and change comparison.

Basic Syntax


git range-diff  

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 and view the changes within a specific time period:


git range-diff .. ..

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 OperationsGit Basic Operations