Pairwise Git Diff
WorktreeWise features a built-in pairwise Git Diff tool powered by diff2html and highlight.js. Visually compare code divergence between any two entities in your repository—worktrees, branches, tags, or commit hashes—with side-by-side dual-column or line-by-line unified diff views.

Pairwise Comparison Matrix
Configure the Source (Left) and Target (Right) comparison endpoints independently using four flexible modes:
| Mode | Target Types | Selection Interface |
|---|---|---|
| Worktree | Active worktrees on disk | Searchable dropdown listing all registered worktrees |
| Branch | Local branches, tracking branches, or main | Dropdown listing all local and upstream branch references |
| Tag | Release versions and milestone tags | Dropdown listing all repository Git tags |
| Commit | Historical commit revisions | Input field accepting 7-character short SHAs or full 40-character hashes |
You can compare across any combination of modes:
- Compare a Worktree against a Branch to preview incoming merge conflicts before pulling.
- Compare two distinct Worktrees to inspect diverging work between parallel feature checkouts.
- Compare a Commit hash against a release Tag to audit cherry-picked hotfixes.
How to Compare Changes
Open Git Diff
Select the Diff button on the Git Log toolbar, or press the global shortcut:
- Shortcut:
Shift + D
Configure Source (Left)
Select the source mode (Worktree, Commit, Branch, or Tag) and pick your desired revision entity from the selector or paste a commit SHA.
Configure Target (Right)
Select the target mode and pick your comparison target. The summary indicator updates dynamically to reflect the comparison path:
Source (feature-auth) ──⇄── Target (main)Adjust Comparison Parameters (Optional)
In the left options panel, fine-tune diff rendering settings:
| Option | Values | Behavior |
|---|---|---|
| Output Format | Side by Side / Line by Line | Dual-pane split view or single-column unified view. |
| Matching Type | Words / Lines / None | Highlights word-level modifications within changed lines. |
| Words Threshold | Number (default: 0.25) | Sensitivity for intra-line word diff matching. |
| Max Comparisons | Number (default: 2500) | Maximum line comparisons performed per change block to preserve performance. |
Run Comparison
Select the blue Compare button. WorktreeWise computes the diff, compresses the payload, and renders the syntax-highlighted diff viewer.
Diff Viewer Features
Interactive File Navigation
The top drawer lists all altered files along with additions (+) and deletions (-) statistics. Selecting any file scrolls the viewer directly to that file’s changes.
Syntax Highlighting & Theme Adaptation
Code syntax highlights automatically based on file extensions. When toggling between WorktreeWise Light and Dark modes (Shift + T), the diff viewer updates dynamically to matching GitHub light and dark color schemes.
Back-to-Top Navigation
For multi-file changes spanning hundreds of lines, select the floating Back to Top button in the lower-right corner to return immediately to the file list summary.
Interpreting Diff Colors:
To preview what your feature branch introduces relative to main, set main as the Source (Left) and your worktree as the Target (Right). New additions appear in green and deleted lines appear in red.
Related Pages
- Git Log & Working Tree: Inspect commit history and stage files inline.
- Create a Git Commit: Author commits after reviewing file diffs.
- Worktree Overview Dashboard: Monitor upstream divergence across worktrees.