# Hunk for Git

> Use Hunk as a terminal Git diff viewer for working trees, staged changes, commits, stashes, pager output, and difftool workflows.

Hunk turns Git changes into one review-first terminal UI: a multi-file stream, file navigation, split or stack layouts, expandable context, watch mode, and inline agent notes. Run Hunk directly for a complete changeset, or connect it to Git as a pager or difftool.

## Start reviewing

```bash
hunk diff
hunk diff --staged
hunk show HEAD~1
hunk stash show
```

## Review the whole working tree

`hunk diff` includes tracked changes and untracked files in one ordered review stream. Add `--exclude-untracked` when you only want files Git already knows about.

## Review staged work, commits, and stashes

Use `hunk diff --staged`, `hunk show <ref>`, or `hunk stash show [stash]`. Pathspecs after `--` narrow the input without changing Hunk's review navigation.

## Pager or difftool

Pager mode lets `git diff` and `git show` open in Hunk. Git difftool integration is pair-oriented because Git invokes it once per file; use `hunk diff` for Hunk's native full-changeset stream.

## Use Hunk from Git commands

```text
git config --global core.pager "hunk pager"
git config --global difftool.hunk.cmd 'hunk difftool "$LOCAL" "$REMOTE" "$MERGED"'
git config --global difftool.prompt false
```

## What to know

Git controls the input in pager mode, so untracked files are not synthesized there. Use `hunk diff` when you want Hunk to assemble the complete working-tree review.

[Read the complete Git workflow documentation](https://hunk.dev/docs/workflows/git-pager-and-difftool/)

[Install Hunk](https://hunk.dev/#install)
