Worktrees

How Tegment pairs every branch with its own working directory and terminals.

Last updated Jul 12, 2026

Tegment is built on a small, deliberate primitive: the git worktree. Every branch you care about gets its own folder and its own terminals, but they all share the same underlying repository.

Why worktrees#

You can keep several branches checked out at once and switch between them instantly, without stashing or losing terminal state. Tegment lists the repository's existing git worktrees and lets you add and remove them from the UI.

Creating a worktree#

Open the new-worktree dialog from the worktree list. You choose:

By default the worktree folder is created next to your clone, as <repo>.worktrees/<branch>. Use Browse to put it somewhere else, or set a default location per repository in settings (see below).

After the worktree is created, Tegment runs your project's post-creation commands (for example installing dependencies) and opens a terminal pane in the new directory.

From an issue or pull request

If you've connected GitHub or Jira, you can create a worktree straight from an issue or PR in the sidebar. Tegment builds the branch name from the issue — for example PROJ-456-add-export — following the branch-name pattern set for that project.

Removing a worktree#

When you're done with a branch, delete its worktree from the worktree menu. Tegment runs git worktree remove to detach it and clean up the folder; if git refuses because the worktree is busy or dirty, you can force the removal.

If a worktree is locked (git marks it locked so it can't be pruned), Tegment can unlock it again from the same menu.

Per-repository settings#

Open Settings and select a repository to set its worktree defaults:

When you create a worktree from a GitHub or Jira issue, the branch name comes from that integration's branch pattern, set in the repository's GitHub or Jira settings.

How worktree rows look#

Because the Terminals section handles starting work, a worktree row is primarily a git unit. Settings → Worktree controls how every row is drawn in the sidebar:

SettingWhat it controls
PR statusShow a linked pull request as a colored icon, a pill with its number, or off
Incoming / outgoingShow ahead/behind (↑/↓) commit counts versus the remote
Line changesShow the +insertions / -deletions indicator
DensityComfortable (branch name and path on two lines) or compact (single line)
Hover actionsOn hover, show a single menu button, or inline quick-action buttons you pick

With Hover actions set to buttons, you choose which appear: Open terminal, Open in IDE, Launch agent, and Run template. Every action stays reachable from the right-click menu whichever style you choose.