Worktrees

Explainer1:30Mac · Host

Chapters

  1. 0:00Three agents, one folder
  2. 0:18A worktree for every task
  3. 0:26A board of its own
  4. 0:34Three versions at once
  5. 0:42Set up once
  6. 0:56Finish from the Git card
  7. 1:04Nothing left behind
  8. 1:12Never miss a sunset

You have three tasks for your app and three agents ready to take them. In one folder they trip over each other: one edits a file another is testing, and their dev servers want the same port. A fresh checkout for each of them needs its node_modules and its setup before anyone can start.

In Offsite each task gets its own worktree. It sits in a column beside your project’s board and opens as a board of its own, with its own branch, its agents and a window of 100 ports, so three versions of your app run at the same time. You set up your worktrees once, by hand or with an agent. Every new one gets its node_modules in seconds, cloned on the disk, and its agent starts when the setup is done. When a task is done, you open a pull request or merge it from its Git card, and every worktree stays in view, including the ones you made elsewhere, until you clean it up.

Tips

  • Press + in the Worktrees column to start one. Begin the task with #123, or paste an issue’s URL into it, and the worktree is linked to that issue.
  • Every app you run in a worktree gets its port as $OFFSITE_PORT. Write --port $OFFSITE_PORT into its Run entry, and each worktree’s copy takes a port of its own.
  • A repository with a .worktreeinclude file and no setup yet starts with its paths in Smart Copy.
  • Host Settings › Worktrees suggests the worktrees that look done: merged into the base, never given a commit, or without a commit or checkout for 30 days.
Transcript