Git Advanced Cheat Sheet/Compare two versions of a branch series

Review how a patch series changed across rebases.

Section: Specialized Tools

Compare two versions of a branch series

bash
bash
git range-diff main...feature-v1 main...feature-v2
Explanation

Especially useful in advanced review workflows after interactive rebase or when patch series evolve.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Specialized Tools
Cherry-pick a range without committing
Apply commit changes into the index and working tree first.
OpenIn sheetbashsame section
Initialize and update submodules recursively
Populate nested submodules after clone or after config changes.
OpenIn sheetbashsame section
Attach a note to a commit
Add metadata to a commit without rewriting it.
OpenIn sheetbashsame section
Interactive rebase last 5 commits
Open the last 5 commits in the interactive rebase todo list.
OpenIn sheetbash2 tag match
Rebase a branch onto a new base
Move a branch from one base commit or branch to another.
OpenIn sheetbash2 tag match
Interactive rebase preserving merges
Rebase while preserving merge topology.
OpenIn sheetbash2 tag match