# 🔍 Detail view
Press `Enter` on a selected item to open a full-screen Detail view. Its header names the open repository — its path as listed on the home screen — with the current branch on the right. The detail view supports twelve tabs for git repositories, organized into two groups:
| **Primary** | **Workspace**, **Files**, **Graph**, **Branches**, **Tags**, **Remotes**, **Stashes** | Always visible. Use `1`–`7` to jump directly. |
| **Advanced** | **Worktrees**, **Submodules**, **Reflog**, **Forge Issues**, **Forge PRs** | Toggled via `Z`. Use `1`–`5` to jump directly when active. |
- Press `Z` from any tab to toggle between **Primary** and **Advanced** tab groups.
- Press `Esc` / `q` / `Q` while viewing the Advanced group to step back to the Primary group (press again to return to the repository list).
- Press `Tab` / `Shift+Tab` to cycle forward/backward through the tabs *within* the currently active group.
- Directly jump to tabs using number keys:
- In **Primary** group: Workspace (`1`), Files (`2`), Graph (`3`), Branches (`4`), Tags (`5`), Remotes (`6`), Stashes (`7`).
- In **Advanced** group: Worktrees (`1`), Submodules (`2`), Reflog (`3`), Forge Issues (`4`), Forge PRs (`5`).
- Press `O` from any tab to toggle the repository **Overview** full-screen overlay.
- Alternatively, you can click on the visible tab headers directly with the mouse to switch tabs.
Press `Esc` or `q` (from the Primary group) to return to the repository list, with the cursor still on the repository you opened.
### Panel Layout & Navigation (Workspace Tab)
For a **git repository**, the **Workspace** tab is split into multiple rounded panels with a 40:60 width ratio on the bottom:
- **Commits (top 50%):** Lists the recent commits in the repository. If there are uncommitted changes, a special row named `Uncommitted changes` will be pinned to the very top.
- **Staging Area / Changed Files (bottom-left 40%):** Lists files that are modified, staged, or untracked. When `Uncommitted changes` is selected at the top, this panel is split vertically into `Staged` and `Unstaged` sections. When a real commit is selected, it is split horizontally, showing the list of files modified in that commit in the top half, and full commit details (hash, author, date, refs, and message) in the bottom half.
- **Staging Details (bottom-right 60%):** Displays the unified diff of the selected file.
### Files Tab
The **Files** tab displays all tracked files in the repository as an interactive directory tree on the left, and a preview panel on the right.
- Directory nodes are prefixed with `>` when collapsed and `▼` when expanded.
- File nodes are prefixed with `📄`.
- **Expand / Toggle Folder:** Select a directory and press `>`, `Right-Arrow`, or `Enter`.
- **Collapse Folder:** Select an expanded directory and press `<` or `,`. Press `Left-Arrow` to collapse **all** folders at once.
- **Preview Panel:** Selecting a file displays its content (up to 100 KB) on the right; selecting a directory displays a list of files and folders directly inside it.
- **File History View:** Select any file in the tree and press `Shift+H` to open a history split-panel view, showing revisions on the left and the revision's diff on the right. Press `Tab` / `w` to cycle focus, and `Esc` / `q` to return.
### Graph Tab
The **Graph** tab renders the git log history graph / branch visualization graph.
### Branches Tab
The **Branches** tab is split vertically into left and right panels:
- **Local Branches (left):** Lists local branches in the repository, sorting the active branch to the top marked with ``.
- **Remote Branches (right):** Lists remote tracking branches.
You can focus either branch panel by pressing `w` / `W` or using the `←` / `→` arrow keys.
- Press `P` (Shift+P) or `p` on a local branch to push it to the remote. In the push confirmation dialog, press `y` to push normally or `t` / `T` to push the branch with tags (`--tags`).
- Press `m` to merge the selected branch into the current branch, or `M` (Shift+M) on a local branch to do the reverse: checkout the selected branch and merge the previously current branch into it (both ask for confirmation).
### Tags Tab
The **Tags** tab lists both local tags and remote tags.
- Tags are created with `t` / `T` from the **Workspace** commits list (at the selected commit). The creation dialog supports both lightweight tags and annotated tags with optional messages (`-m`); use `Tab` to switch input focus between Tag Name and Tag Message. If the tag name already exists, Gitwig prompts to force update (`-f -a -m`).
- Select a local tag and press `↵` (Enter) to checkout that tag.
- Select any tag and press `D` to delete it (asks for confirmation).
- Press `p` to push the selected tag to the remote. In the push confirmation dialog, press `y` to push normally or `f` / `F` to force push (`--force`).
- Press `P` (Shift+P) to push all tags to the remote (asks for confirmation).
### Remotes Tab
The **Remotes** tab lists configured remotes for the repository.
### Stashes Tab
The **Stashes** tab lists all available stashes in the repository with a horizontally split layout:
- **Stashes (Top-Left):** Lists all stashes. Selecting a stash automatically highlights the first file in the files list. Press `D` to delete the selected stash, or `a` / `A` to apply it (both options ask for confirmation). When applying, you can toggle whether to delete the stash after applying (default is Yes).
- **Stashed Files (Bottom-Left):** Lists the files changed/saved in the selected stash.
- **Stash Diff (Right):** Shows the unified patch diff of the selected file.
- Navigate stashes or stashed files using `↑`/`k` and `↓`/`j`.
### Stashing UI
Pressing `s` / `S` inside the **Workspace** tab opens the dedicated **Stashing UI** overlay popup:
- **Left Panel:** Displays the list of all modified, staged, unstaged, untracked, and conflicted files that will be stashed. You can navigate through this list using `↑`/`↓`/`k`/`j`.
- **Right Panel:** Displays checkboxes for stashing options:
- Toggle stashing untracked files with `u`.
- Toggle keeping the index with `i`.
- **Actions:**
- Press `s` to save the stash. This opens a text prompt to input an optional stash message/name (where stashing options can also be toggled with `Ctrl+U` and `Ctrl+I`).
- Press `Esc` / `q` / `Q` to cancel and return to the Workspace view.
### Worktrees Tab
The **Worktrees** tab lists the Git worktrees linked to the repository (the main worktree itself is not listed), with each one's branch, lock status and path; a worktree whose folder is gone is marked `(Missing)`.
- Press `a` to add a new worktree. You are prompted for a branch, tag or commit to check out — or a new branch name, which is created at HEAD for the worktree (a branch that exists only on one remote is checked out tracking it) — followed by the destination path.
- Press `l` to toggle the lock on the selected worktree (asks for an optional reason when locking).
- Press `D` to remove the selected worktree and its folder. The status bar asks for a choice: `1` removes it only if it is clean (a worktree with uncommitted changes, or a locked one, is refused and nothing is deleted); `2` force-removes it, discarding uncommitted changes and overriding a lock. `Esc` cancels.
- Press `p` to prune stale worktree metadata (for worktrees whose folder no longer exists).
- Press `Enter` to open the selected worktree: it is added to the Home screen list (or its existing entry is opened, if it is already tracked under any spelling of its path), and the repository view starts on the Primary tabs.
### Submodules Tab
The **Submodules** tab lists all git submodules defined in the repository:
- **Name:** The submodule identifier.
- **Status:** Shows `Clean`, `Modified` (local changes or commit mismatch), `Uninitialized`, or `Removal staged` (deleted with `D`, until you commit the removal).
- **Commit (Index):** The target commit SHA the superproject expects.
- **Commit (HEAD):** The commit SHA the superproject's HEAD records, highlighted when it differs from the index (a staged submodule change). Where the submodule itself is checked out shows in its status: `Modified` when that differs from the index.
- **URL:** The remote source URL of the submodule.
- Press `a` to add a submodule: enter its repository URL, then the path to check it out at. It is cloned and initialized.
- Press `D` to delete the selected submodule (asks confirmation; the popup names its path, and its name when that differs). It is deinitialized and its folder, gitlink, `.gitmodules` entry and module directory are removed; the removal is staged for you to commit.
- Press `u` to initialize / update the selected submodule, or `U` for every submodule (`git submodule update --init --recursive`, never forced). An `Uninitialized` submodule is cloned and checked out; a `Modified` one goes back to the commit the repository records, after a confirmation, since commits made there that no branch holds are left behind. Uncommitted changes the checkout would overwrite make the update fail instead.
### Reflog Tab
The **Reflog** tab lists HEAD reflog entries for the repository, enabling easy recovery of lost commits and branches:
- **Selector:** The reflog reference index (e.g. `HEAD@{0}`).
- **Commit OID:** Shortened commit target hash.
- **Action:** The action type (e.g. `checkout`, `commit`, `rebase`, `reset`), highlighted based on the action.
- **Message:** The action details and commit message.
- **Time / Date:** Relative age and absolute UTC date of the operation.
- **Checkout Commit:** Press `Enter` or `Space` on any entry to check out that commit (detached HEAD). A confirmation dialog asks first.
### Forge Issues Tab
The **Forge Issues** tab lists the repository's open GitHub issues through the GitHub CLI (`gh`, which must be installed and signed in), with the selected issue's details below.
- Press `a` to toggle between issues assigned to you (the default) and all open issues.
- Press `Enter` to switch to the issue's branch (asks confirmation): the branch linked to it on GitHub, if there is exactly one and it is in this clone; otherwise the one branch whose name carries the issue number as a token of its own (`issue-12-login` or `12-fix` for #12); otherwise a new `issue-<number>` branch. Several candidates are reported rather than guessed between.
- Press `o` to open the issue in your browser.
### Forge PRs Tab
The **Forge PRs** tab lists open pull requests through `gh`, with the selected PR's details below: its CI/CD checks (check runs and commit statuses; a running check shows its status, e.g. `IN_PROGRESS`), reviews, and line comments.
- Press `Enter` to check out the PR's branch with `gh pr checkout` (asks confirmation).
- Press `o` to open the PR in your browser.
- Press `n` to add a line comment in three steps: file path, line number (1 or more) and comment text. An invalid entry shows an error and keeps the step open. The comment is posted to the PR's head commit exactly as typed.
- If the line comments fail to load, the error is shown in the details panel; press `R` to retry.
### Overview Overlay
Pressing `O` from any repository detail tab displays the **Overview** overlay, showing resolved paths, tracking info, and committer statistics. Press `Tab` / `w` / `W` to cycle focus between the Overview and Stats panes, and `↑`/`↓`/`j`/`k`, `PgUp`/`PgDn`, `Home`/`End` to scroll the focused pane. Press `Esc`, `q`, or `O` to return to your workspace. Press `s` inside the Overview overlay to open the Repository Settings page.
### Navigation & Interaction
You can navigate and interact with these panels in the following ways:
- **Cycle Focus:** In the Workspace, Files, Branches, Tags, Stashes, Worktrees, Submodules, and Reflog tabs, press `w` / `W` to cycle panel focus:
- **Workspace tab:** `Commits` → `Staged` → `Unstaged` → `StagingDetails`.
- **Files tab:** `Files` (left tree list) ↔ `FileContent` (right preview panel).
- **Branches tab:** `Local Branches` ↔ `Remote Branches`.
- **Tags tab:** `Local Tags` ↔ `Remote Tags`.
- **Stashes tab:** `Stashes` → `Stashed Files` → `StagingDetails`.
- **Worktrees tab:** `Worktrees` (main table).
- **Submodules tab:** `Submodules` (main table).
- **Reflog tab:** `Reflog` (main table).
Focus defaults to the main panel of the tab when switching tabs (e.g., `Commits` on Workspace tab, `Files` on Files tab, `Local Branches` on Branches tab, `Local Tags` on Tags tab, `Stashes` on Stashes tab, `Worktrees` on Worktrees tab, `Submodules` on Submodules tab, `Reflog` on Reflog tab).
- **Mouse Click to Focus/Select:** Left-click inside any panel's boundaries (including branch/tag/stash list panels, stashed files list, files list, and the files tab content preview panel) to focus it immediately. In the Worktrees, Submodules, Reflog, Forge Issues and Forge PRs lists a click also selects the row it hits, even when the list is scrolled.
- **Resize Split Panels:** Left-click and drag the vertical or horizontal boundary splitter lines between panels to resize them dynamically, or press `+` / `-` to grow / shrink the currently focused panel from the keyboard (5% steps along the same splits, clamped to the same limits). Mouse dragging is supported in:
- **Workspace / Inspect:** Main vertical split (commits vs details), bottom horizontal split (left list vs right diff), and left vertical split (staged vs unstaged or commit details vs files list).
- **Files:** Horizontal split (repository files tree vs file content preview).
- **Branches:** Horizontal split (local branches vs remote branches).
- **Stashes:** Horizontal split (stash lists vs diff) and left vertical split (stashes list vs stashed files).
- **Overview Overlay:** Horizontal split (overview info vs committer stats).
- **Forge Issues / Forge PRs:** Vertical split (list vs details).
- **Mouse Wheel Scroll:** Use the mouse wheel to scroll vertically through the active list, commit history, branch list, files list, stashed files list, staging details diff, files tab preview panel, or the Worktrees, Submodules, Reflog, Forge Issues and Forge PRs lists.
- **Navigate Lists:** Use `↑`/`k`/`K` and `↓`/`j`/`J` to select a commit, file, branch, tag, stash, stashed file, file tree item, worktree, submodule, reflog entry, issue or pull request in the active list. Long lists scroll to keep the selection in view.
- **Scroll Diff:** When the `Staging Details` panel is focused, you can scroll the unified diff text vertically using `↑`/`k` and `↓`/`j` (line-by-line) or `PgUp`/`PgDn` (page-by-page).
- **Scroll File Content:** When the files tab `FileContent` preview panel is focused, you can scroll the preview text vertically using `↑`/`k` and `↓`/`j` (line-by-line) or `PgUp`/`PgDn` (page-by-page).
- **Stage/Unstage Files:** Select the `Uncommitted changes` row at the top, select a file in either the `Staged` or `Unstaged` list, and press `Enter` to stage or unstage that file instantly. Press `a` to Stage All (when focused on Unstaged) or Unstage All (when focused on Staged), which automatically shifts panel focus to the opposite list. Press `x` to discard changes in the selected file, or `X` to discard all changes in the repository (both ask for confirmation before performing).
- **Checkout Commit (Workspace Commits List):** Select a commit in the Commits panel of the Workspace tab and press `o` to check it out. A confirmation dialog will prompt before checking out the commit into a detached HEAD state.
- **Network Progress Bar:** Any long-running network operations (such as Fetch, Pull, or Push) will display a centering animated progress bar popup so the UI thread remains responsive and visual feedback is clear. If an operation hangs or takes too long, you can press `Esc` to force-dismiss the progress popup and resume TUI interaction immediately.
- **Multi-Remote Selection Picker:** For write operations (pushing branch/tags, deleting tags, fetching tags), if the repository has multiple configured remotes and no upstream tracking branch is set, a selection picker popup will appear allowing you to select which remote to target using ↑↓ and Enter.
- **Manage Branches:** While on the **Branches** tab:
- Select any **local branch** (other than the currently active one) and press `Enter` to check it out (safe checkout strategy applies).
- Press `f` / `F` to fetch updates from the remote in the background.
- Select any **local branch** and press `p` to pull updates from its remote in the background (can only pull into the currently checked-out branch).
- Select any **local branch** and press `Shift+P` to push it to the remote in the background (if no upstream is configured, it will attempt to push to the first configured remote and set it as the upstream tracking branch).
- Select any **remote branch** and press `Enter` to check it out (this will switch to the branch, creating a local tracking branch if it doesn't already exist).
- Press `c` / `C` to create a new branch from the currently checked out branch (or HEAD). A popup dialog will prompt for the new branch name.
- Select any local or remote-tracking branch and press `D` to delete it. A confirmation dialog will prompt before performing the deletion. (The currently checked out branch cannot be deleted).
- **Commit Staged Changes / Amend Last Commit:** Press `c` from the Workspace tab or from the Inspect view to open a centered Commit popup window (active if there are staged changes OR a prior HEAD commit exists to amend).
- **Compose Mode:** Type your commit message. Press `Ctrl+S` to submit directly, `Ctrl+U` to clear the entire message buffer, `Ctrl+A` to toggle amend, `Ctrl+H` to pick previous messages from history, `Ctrl+D` to maximize/restore popup size, `Ctrl+C` to lock in the text and switch to confirmation state, press `Enter` to insert a newline, or `Esc` to cancel.
- **Confirm Mode:** Press `Enter` to execute the commit, `e` to return to composing/editing the message, `a` / `Space` to toggle the "Amend last commit" option, `x` / `u` to clear the message, `d` / `m` to maximize/restore popup size, or `Esc`/`q` to close the popup. Toggling amend to active when the buffer is empty automatically populates the text box with the message from the last commit.
For a **plain directory** the view confirms the resolved path and explains that no `.git` entry was found.
For a **missing** item the view confirms the resolved path and notes that the path does not exist or isn't accessible.
The detail snapshot is taken **once** when you press Enter — it is not refreshed while open (except for staging/unstaging actions which refresh dynamically). Close and re-open to re-read the repository state.
After every successful add / edit / delete, the status bar briefly shows `Saved` or `Deleted`. If the write fails, the status bar shows `Save failed: <reason>` instead — your in-memory list still reflects the change, but the file on disk does not.
### 🔀 Main Page Sorting
The main page repository list can be sorted dynamically using shortcuts:
- **Cycle Sort Order (`o`):** Cycles through the sorting modes: `Custom` (preserves your manual list order), `Alphabetical`, `Recent Visit` (tracks when you enter a repository's detail view), and `Latest Changes` (based on HEAD commit timestamps or folder modification times; the list re-sorts by itself when a refresh finds a repository's latest commit has changed, keeping the cursor on its repository).
- **Toggle Sort Direction (`O`):** Toggles ascending vs. descending/reversed sort direction. The rule under the home header displays the active sort mode (e.g. `Sort: Alphabetical (Rev)`); with `show_separators = false` the caption is shown without the rule.
- **Pinned repositories** (`p`) stay at the top of the list, and of each label group, in every sort order, sorted among themselves; a faint dashed rule under the last pinned row marks where the pinned block ends (hidden with `show_separators = false`).
- **Per-label sort and layout:** a label's Label Settings can set its own Sort By, Sort Reverse and View Mode, used instead of the global ones while that label's filter is active; `o`, `O` and `v` then change the label's values (see [Per-label settings](configuration.md#per-label-settings)).