Skip to Content

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.

Git Diff comparison dialog


Pairwise Comparison Matrix

Configure the Source (Left) and Target (Right) comparison endpoints independently using four flexible modes:

ModeTarget TypesSelection Interface
WorktreeActive worktrees on diskSearchable dropdown listing all registered worktrees
BranchLocal branches, tracking branches, or mainDropdown listing all local and upstream branch references
TagRelease versions and milestone tagsDropdown listing all repository Git tags
CommitHistorical commit revisionsInput 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:

OptionValuesBehavior
Output FormatSide by Side / Line by LineDual-pane split view or single-column unified view.
Matching TypeWords / Lines / NoneHighlights word-level modifications within changed lines.
Words ThresholdNumber (default: 0.25)Sensitivity for intra-line word diff matching.
Max ComparisonsNumber (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.