Skip to content
Everyday Git

Status and staging

Staged, unstaged, untracked and conflicted files, with hunk-level and line-level staging.

GitAegis
GitAegis Work mode, showing hunk-level staging beside a file diff, with the command strip displaying the exact Git invocation.
Hunk-level staging, and the exact `git` invocation that will run.

The four groups

Work mode (⌘2) reads status from git status --porcelain=v2 --branch --untracked-files=all -z, run with optional locks disabled so a status refresh never competes for .git/index.lock with a mutation of your own. Per-path line counts are merged in from git diff --numstat and git diff --cached --numstat.

The result keeps the distinctions Git makes rather than flattening them: staged, unstaged, untracked and conflicted are four separate groups, not one list with icons. Renames arrive as renames. Stashes, worktrees, submodules and the in-progress sequencer marker are composed onto the same status object, which is why the merge you left half-finished is visible from the staging panel and not only from the terminal.

Whole-file staging

Selecting files and staging them runs the plain commands, and the plan says so before it runs. This is safe work, so nothing is captured first and no checkpoint is offered afterwards.

planned commands
# stage
git add -- src/editor/autosave.ts
# unstage
git reset -q HEAD -- src/editor/autosave.ts
Both are journalled like every other operation, so the Activity centre shows what moved and when.

Hunk and line staging

Each hunk carries its own control in its own header, and lines inside a hunk can be selected and staged as exactly that selection.

Two hunks of a diff in GitAegis Work mode, each with its own Stage hunk control in the hunk header.
One control per hunk, in the hunk's own header.
Three of a hunk's seven added lines selected via the gutter checkboxes, with the selection bar reading 3 lines selected and offering to stage or discard exactly those lines.
Three of seven added lines selected: staged, or discarded, as exactly that selection.

The interface never sends a patch. It sends hunk ids, line indexes, and a short-lived state token that describes the diff you were looking at. The core re-reads the real diff, compares the token, regenerates the patch itself, and runs Git’s own --check pass before applying anything. If the file changed under you between review and confirmation, the token no longer matches and the operation is refused with a message telling you to refresh the diff. It does not stage a guess.

what the core applies
stage     git apply --cached --unidiff-zero
unstage   git apply --cached --reverse --unidiff-zero
discard   git apply --reverse --unidiff-zero
Patch bytes are generated inside the core from the freshly re-read diff; they never cross IPC and never enter the journal.

Success is checked, not assumed: a partial mutation must change the state token it started from, or the operation does not report success.

Where partial staging stops

Ordinary text modifications only

A partial change is available for a modified text file. Added, deleted, renamed and metadata-only paths take the whole-file action instead, as do binary files, images, and files the diff reader marked too large. The app says which case you are in rather than offering a control that would fail.

One to 256 selections, and a 1 MiB patch

A single partial operation carries between one and 256 hunk selections, and the regenerated patch is capped at 1 MiB. Past that, use the whole-file action.

Discard is not staging

Discard is available at the same granularities (file, hunk, selected lines) and it is classified as what it is.

Staging operations, their risk classification and what is captured before they run
OperationRiskCaptured first
Stage / unstagesafeNothing
Stage / unstage a selectionsafeNothing
DiscarddestructiveStandard capsule, untracked files included

The discarded content lives in the capsule’s patches, so the rollback step in the plan is real: re-apply the discarded changes from the checkpoint patch.

The diff itself

Unified or side-by-side, per-hunk actions, line selection, a whitespace menu and a copy menu, and explicit states for binary, image, too-large and empty files rather than an attempt to render four megabytes of minified JavaScript. External diff tools are never launched: diff.tool is not consulted, in any mode.

30-day trial · No card required

A recovery capsule before every risky Git operation.

You see the exact commands before they run, and the operation is refused if the capsule cannot be written.

Requires Git 2.38.0 or newer, already installed.

Every risky operation, in this order

  1. Previewthe exact commands, shown before anything runs
  2. Capsulerefs, index, staged and working changes, untracked files, operation state: written to disk first
  3. Executethe commands as shown, or not at all
  4. Journalplan, commands, capsule id, outcome
No capsule, no operation. Restore plans, previews, and takes its own capsule.