Files
tty7/docs/git/source-control.mdx
T
l0ng-ai 00e1aa8218 docs: correct claims that no longer match the code
Audited every page under docs/ against the source. Fixes for what the
code actually does:

- agents: the status vocabulary is idle/working/waiting/done, not
  running/waiting/idle; hook rows grow a separate Uninstall button; the
  Settings table labels read "Copilot CLI" and "Grok Build"; Copy Session
  ID lives in the tab's context menu, not the pane's
- cli: `pane ls --all` reports the owning workspace id, not "tty7-cli";
  document bare `tty7 [PATH]` as the GUI launcher it is instead of listing
  it as unimplemented; note `active_tab` and the `diagnostics` array; wait
  also defaults to $TTY7_PANE
- git: the branch dropdown is a plain list with no search box and no
  stash-and-switch, and checkout is not a palette command; quote the diff
  overlay's own overflow notice rather than the sidebar's
- window: the unread marker tracks a finished agent turn, not any output;
  rows cannot be dragged across groups; the sidebar and `tty7 tab ls`
  resolve labels differently; drop Toggle Commit History and Checkout to
  from the palette's Git group; ~/.ssh/config aliases are not palette
  entries
- terminal: Ctrl+R dedups by command text and shows no directory; Esc does
  not dismiss a ghost suggestion; document Cmd+Enter
- remote: GSSAPI is an ordinary Auth choice, not a managed-connection-only
  mechanism
- fonts: Maple Mono NF CN leads the chain on Windows and Linux only; list
  the real per-platform defaults
- settings paths: the three Links settings and per-pane history were filed
  under the wrong sections
2026-08-11 14:35:54 +08:00

102 lines
3.9 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: "Source control"
description: "Stage, commit, branch, and push from the panel beside your terminal."
---
The **Source Control** tab of the [side panel](/window/side-panel) (<kbd>⌘ J</kbd>)
is a full git client for whichever repository the focused pane is in. It follows
the pane: `cd` into another repository and the panel switches with you.
<Frame caption="Placeholder — screenshot: the Source Control panel with staged and unstaged groups and a commit box">
<img src="/images/placeholder.svg" alt="The tty7 source control panel" />
</Frame>
## Changes
Files are grouped by what git thinks of them:
| Group | |
|---|---|
| **Merge Changes** | Conflicts, with *Resolve Conflict* and *Mark as Resolved* |
| **Staged Changes** | What the next commit will contain |
| **Changes** | Modified but not staged |
| **Untracked** | New files |
Each row has **Stage Changes**, **Unstage Changes**, **Discard Changes**, and
**Open Changes** — which opens the [diff](/git/diffs). Group-level *Stage All*,
*Unstage All*, and *Discard All* sit on the headers, and the destructive ones
confirm first.
## Committing
Write the message in the box at the top and pick a commit action:
| | |
|---|---|
| **Commit** | Commit what is staged |
| **Commit All** | Stage everything, then commit |
| **Commit (Amend)** | Replace the last commit — confirms first, because anyone who already has it has to reconcile |
| **Commit & Push** | Commit, then push |
| **Commit & Sync** | Commit, then pull and push |
<kbd>⌘ ⏎</kbd> commits while the caret is in the message box. **Stash All** is
there too.
## Branches and remotes
The branch name at the top of the panel is a dropdown. It holds:
| | |
|---|---|
| **The branch list** | Click one to check it out. Past a dozen branches the list scrolls instead of growing past the window |
| **Create Branch…** | From here, or from any commit in the history |
| **Fetch** · **Pull** · **Push** | Individually |
| **Switch Repository** | Only when the window has panes in more than one repo |
Beside it, the sync button pulls then pushes — and relabels itself **Publish
Branch** when the branch has no upstream yet.
The command palette carries the verbs under **Git** — *Git: Commit*, *Stage
All*, *Unstage All*, *Discard All*, *Create Branch*, *Sync*, *Push*, *Pull*,
*Fetch* — so those are bindable. Checking out is a pick rather than a verb, so
it lives only in the dropdown.
<Warning>
Checking out does not stash for you. A dirty tree that would be clobbered
makes git refuse the checkout, and tty7 shows you git's own refusal as a
notification rather than working around it.
</Warning>
When a repository is mid-operation — merging, rebasing, cherry-picking,
reverting, bisecting, applying — the panel says so instead of pretending
everything is normal.
## History
The *History* section header opens the commit graph: branches drawn as lanes, a
filter box, **Current Branch** or **All Branches**, and *Load more* at the
bottom.
**Git: Toggle Commit History** does the same from the keyboard. It ships with no
default key — bind one under **Settings → Keyboard Shortcuts**.
Click a commit for its detail view — message, parents, and the files it touched,
each openable as a diff. From a commit's menu:
| | |
|---|---|
| **Checkout Commit** · **Create Branch Here…** | Move to it |
| **Cherry Pick** · **Revert Commit** | Apply or undo it here |
| **Reset (Soft / Mixed / Hard)** | Move the branch to it — Hard confirms, since commits after it fall off the branch and uncommitted changes are discarded |
| **Copy Commit SHA** | |
The history section starts collapsed and remembers whether you opened it
(`scm_graph_expanded`).
## In the sidebar
You do not have to open the panel to know where you stand: every
[sidebar row](/window/sidebar) carries its pane's branch and a `+N M` count of
the working tree, refreshed on `cd` and when a command finishes. Clicking the
counts opens the diff overlay.