Skip to content

Working trees and commits

Use diff for working-copy or comparison input and show for one committed change.

Terminal window
hunk diff

For Git and Sapling working-copy reviews, Hunk includes untracked or unknown files by default. Exclude them explicitly:

Terminal window
hunk diff --exclude-untracked

Review only staged Git changes with either spelling:

Terminal window
hunk diff --staged
hunk diff --cached
Terminal window
hunk diff main
hunk diff main...feature -- src/core

Arguments after -- are pathspecs. Before --, the target is interpreted by the detected VCS.

Terminal window
hunk show
hunk show HEAD~2 -- README.md src/ui

show defaults to the latest commit. The loaded files still form one review stream, so path filtering changes the input rather than changing navigation behavior.

Git repositories can open a stash directly:

Terminal window
hunk stash show
hunk stash show stash@{2}

Staging areas and stashes are Git-only. Hunk reports a focused error if these operations are requested under a VCS that does not support them.