Skip to content

Worktree Management

pertmux integrates with worktrunk (wt) to provide full worktree lifecycle management from within the TUI.

Install worktrunk and ensure wt is on your PATH:

Terminal window
cargo install worktrunk

The worktree panel is rendered at the top of the dashboard, with the MR list below it. The worktree panel is default focused when you open the dashboard.

Each worktree card shows:

  • Branch name with ahead/behind indicators
  • Last commit message
  • Commit age (e.g., “2h ago”, “3d ago”)
  • Git status symbols (modified, staged, untracked files)
KeyAction
TabSwitch between worktree panel and MR list
cCreate a new worktree
dDelete selected worktree
mMerge selected worktree into the default branch
EnterJump to the worktree’s tmux pane

When you press c, pertmux opens a popup dialog where you enter the branch name. It then runs wt create to:

  1. Show an in-progress toast (“Creating worktree…”)
  2. Create a new worktree directory
  3. Create and checkout the branch
  4. Automatically refresh the dashboard (MR linking updates immediately)

Press m on a worktree to merge it into the default branch. pertmux runs wt merge which:

  1. Show an in-progress toast (“Merging worktree…”)
  2. Merges the branch into the default branch
  3. Cleans up the worktree directory
  4. Removes the local branch
  5. Automatically refresh the dashboard

When the default_agent_command is set in your config, pressing Enter on a worktree creates a horizontal split in tmux:

  • Left pane: Runs the specified agent command (e.g., opencode)
  • Right pane: Opens an empty terminal in the worktree directory

This allows you to start working with an agent immediately upon focusing a worktree.