Worktree Management
pertmux integrates with worktrunk (wt) to provide full worktree lifecycle management from within the TUI.
Prerequisites
Section titled “Prerequisites”Install worktrunk and ensure wt is on your PATH:
cargo install worktrunkWorktree panel
Section titled “Worktree panel”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)
Actions
Section titled “Actions”| Key | Action |
|---|---|
Tab | Switch between worktree panel and MR list |
c | Create a new worktree |
d | Delete selected worktree |
m | Merge selected worktree into the default branch |
Enter | Jump to the worktree’s tmux pane |
Create workflow
Section titled “Create workflow”When you press c, pertmux opens a popup dialog where you enter the branch name. It then runs wt create to:
- Show an in-progress toast (“Creating worktree…”)
- Create a new worktree directory
- Create and checkout the branch
- Automatically refresh the dashboard (MR linking updates immediately)
Merge workflow
Section titled “Merge workflow”Press m on a worktree to merge it into the default branch. pertmux runs wt merge which:
- Show an in-progress toast (“Merging worktree…”)
- Merges the branch into the default branch
- Cleans up the worktree directory
- Removes the local branch
- Automatically refresh the dashboard
Split pane with agent
Section titled “Split pane with agent”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.