Repository navigation
13 Diff View
The diff view is a branch-review surface inside the TUI:
every file you've changed since you branched off main (or
whatever your trunk is), with hunk navigation, jump-to-editor,
and lazygit handoff. Press G to open it.
It shows everything since the merge-base, not the
working-tree-vs-last-commit slice that git diff HEAD shows.
Committed changes, working-tree changes, and untracked files
(filtered through .gitignore) all appear.
croft # open the dashboard
G # open the diff view↑ / ↓ move between files
Tab switch focus to the diff body
↑ / ↓ scroll the diff (when body focused)
] / [ next / previous hunk
e open the selected file in your editor
L hand off to lazygit
r refresh (recompute merge-base)
q / Esc back to dashboard
The top bar shows <your-branch> vs <trunk> so you always see
what the file list is scoped against.
-
Anchored to a merge-base, not to
HEAD. The view answers "what would my PR contain?" — everything since you forked off the trunk, not just uncommitted edits. -
Trunk is auto-detected. Conventional names (
main,master,develop,trunk) work without config. The detection order is documented below; pin manually if your project uses something else. -
Refreshing keeps it honest. Press
r(or switch views and back) to recompute the merge-base after pulling — otherwise the comparison can stay pinned to a stale trunk SHA.
G from the dashboard. Use ↑ / ↓ to walk the file list;
Tab into the body and ] / [ jump between hunks of the
selected file.
[diff]
base = "release/stable"Detection short-circuits before any git lookup — useful for
projects where main isn't the integration branch.
In the files panel, press e on the selected row. croft opens
your [editor].command / $VISUAL / $EDITOR / vim (in that
order). Terminal editors suspend the TUI and resume on exit;
GUI editors spawn detached. After a terminal-editor session,
the diff reloads automatically. See
TUI § Editor integration.
L from the diff view. croft leaves the alternate screen, runs
lazygit foreground, and re-enters when you q out. Commits /
stages / resets done inside lazygit invalidate the cached diff —
croft reloads automatically. No-op (with a hint flashed in the
status bar) when lazygit isn't on PATH.
r recomputes the merge-base. Use after git pull origin main
shifts the trunk forward — otherwise <your-branch> vs <trunk>
keeps comparing against the pre-pull SHA.
Every file that differs from the merge-base with the resolved trunk:
- Committed-since-branching changes.
- Working-tree changes (staged + unstaged).
- Untracked files (filtered through
.gitignore).
Status flags in the files panel: M modified, A added, D
deleted, ? untracked.
In order, first match wins:
-
[diff].base = "..."incroft.tomlif set. -
git symbolic-ref refs/remotes/origin/HEAD— the remote default branch when a remote is configured. - Local fallback:
main,master,develop,trunk, in that order. - None of the above → fall back to
git diff HEADso the view still works in repos with no trunk (freshgit init, detached repos, etc.).
-
Files panel — every file that differs, with status flags.
↑/↓selects. -
Body panel — diff for the selected file.
Tabcycles focus between files and body. In body focus,↑/↓scrolls;]/[jumps between hunks.
| Key | Context | Action |
|---|---|---|
Tab |
Always | Cycle focus files ↔ body. |
↑ / ↓
|
Files | Move file selection. |
↑ / ↓
|
Body | Scroll diff. |
] / [
|
Body | Next / previous hunk. |
e |
Files | Open selected file in $EDITOR — see TUI § Editor. |
L |
Always | Hand off to lazygit (when installed). |
r |
Always | Refresh trunk + recompute merge-base. |
q / Esc
|
Always | Back to dashboard. |
- TUI — the dashboard the diff view is part of, including editor + lazygit handoff details.
-
Configuration Reference:
[diff]. -
Configuration Reference:
[editor]for pinning a project editor.
croft is dual-licensed under MIT or Apache 2.0. Source: github.com/nsrosenqvist/croft. Back to Home.