Files
tty7/docs/git/worktrees.mdx
T
l0ng-aiandl0ng-ai 707fd1867b docs: add a Mintlify documentation site (#478)
38 pages under docs/, written against the source rather than the README:
config keys and their clamps from core::config, default keybindings from
ui::keymap, every CLI verb and flag from tty7-cli, agent aliases and
hook/fork/resume support from core::cli_agent, and Settings paths taken
from the actual en-US strings.

docs/features.md and its zh-CN translation are retired — everything in
them now lives in a page of its own, plus the two things they carried
that nothing else did (IME input, the performance notes). README and
README.zh-CN point at docs/ instead.

Screenshots and videos are placeholders for now: docs/images/placeholder.svg
with a caption naming what each shot should be.

Co-authored-by: l0ng-ai <24760907+l0ng-ai@users.noreply.github.com>
2026-08-11 00:38:11 +08:00

57 lines
1.8 KiB
Plaintext

---
title: "Worktrees"
description: "An isolated checkout on a fresh branch, in one dialog and one tab."
---
Running two agents on the same repository at once means they fight over the
working tree. A git worktree is the fix, and tty7 makes it a single dialog.
## Creating one
**New Worktree Tab…** — in the command palette, the tab's right-click menu, and
the application menu — asks three things:
| Field | Default |
|---|---|
| **Worktree Name** | A fresh name that does not collide with an existing branch or directory |
| **New Branch** | The same name, editable |
| **Start From** | The branch you are currently on |
Each field opens on a suggestion you can accept or type straight over.
<Frame caption="Placeholder — screenshot: the New Worktree Tab dialog">
<img src="/images/placeholder.svg" alt="Creating a worktree" />
</Frame>
Confirm and tty7 creates the worktree, opens a tab in it, and starts a shell
there. The [sidebar](/window/sidebar) files it under the same repository group as
its parent, on its own branch.
## Where they go
Worktrees land inside the repository, under:
```
<repo>/.tty7/worktrees/<name>
```
`<repo>/.tty7/.gitignore` is created with `*` in it the first time, so the
directory never shows up as an untracked mess in your own repository.
## Removing one
Closing a worktree tab offers to remove the worktree with it:
- **Clean tree** — *Remove Worktree* or *Keep*.
- **Dirty tree** — the dialog says so, and removing requires the explicit
*Discard Changes & Remove*.
Nothing is removed silently, and *Keep* leaves the worktree on disk for `git
worktree list` to find later.
<Tip>
Pair this with [agent sessions](/agents/sessions): a worktree per agent means
two Claude Codes can work on the same repository without stepping on each
other's files.
</Tip>