Diff Review

The diff review workflow lets you approve or reject individual hunks within a file — enabling selective staging of exactly the changes you want to commit.

grüt
Diff review panel showing hunk-level approve and reject workflow
Diff viewer with hunk-level approve/reject controls

Review Panel

The review panel shows the diff for a file broken into discrete hunks. Each hunk represents a contiguous block of changes (additions, deletions, or modifications). Every hunk has its own status indicator:

  • Pending — not yet reviewed
  • Approved — will be staged
  • Rejected — will be discarded

Navigate between hunks and set their status to build up exactly the change set you want.

Hunk Actions

KeyAction
nJump to next hunk
NJump to previous hunk
aApprove the current hunk
xReject the current hunk
rReset hunk to pending
EnterApply — stage approved hunks, discard rejected
EscCancel review without applying changes

Selective Staging

This workflow is designed for situations where a file contains multiple unrelated changes and you want to commit them separately. Instead of staging the entire file, you review each hunk and decide:

  1. Navigate to a modified file in the status panel
  2. Enter diff review mode
  3. Review each hunk — press a to approve or x to reject
  4. Press Enter to apply your decisions
  5. Approved hunks are staged; rejected hunks are discarded from the working tree
  6. Pending hunks (neither approved nor rejected) remain as unstaged changes

This gives you the same power as git add -p but with a visual interface that shows the full context of each hunk.

Batch Actions

For files with many hunks, you can use batch actions to speed up the review:

KeyAction
AApprove all hunks in the current file
XReject all hunks in the current file
RReset all hunks to pending

Review Status Bar

The status bar at the bottom of the review panel shows a summary of your progress:

  • Total number of hunks in the file
  • Count of approved, rejected, and pending hunks
  • Current hunk position (e.g., "3 of 7")

Next Steps