Skip to content

Finish and clean up

A worktree is finished in its Git card. The card’s main button always shows the next step for the branch, and its menu holds the rest.

The button follows the branch through its life:

StateButton
changed files, nothing stagedStage all
staged changesCommit, or Commit & Push from the menu
new branch, nothing on the remotePublish branch
commits to pushPush 2 commits, or Push to PR #12 once a pull request is open
the base moved and conflictsUpdate from main
pushed, no pull request yetCreate pull request
a pull request is openReview and merge PR #12, or Open checks of PR #12 while checks run
mergedDelete worktree

After a merge the branch can carry new work: the badge counts the commits since, and Push and Create pull request come back for them.

Update from main in the menu merges the base into the worktree’s branch. When files conflict, the merge stays open and the button turns into Resolve conflicts:

  • Resolve conflicts with an agent… opens a dialog where you pick an agent. It merges, resolves each file so both sides keep their intent, and stages the result. You read the diff in the Git card and press Commit merge.
  • Abort merge… in the menu restores the branch as it was.

Rebase onto main… is in the menu too, for a branch you prefer to rebase.

Create pull request pushes the branch and asks for:

  • the base it merges into
  • a Title, the last commit’s subject when you leave it empty; the sparkle button asks an agent for a title and description from the branch’s commits
  • a Description, the repository’s pull request template when empty
  • Draft

A worktree linked to an issue adds Fixes #42 to the description, so the issue closes with the merge. Without the GitHub CLI on the host, Offsite pushes the branch and points you to GitHub’s compare page to open the pull request there.

Checks of PR #12 shows the pull request: its checks, reviews and comments, with Request review…, Ready for review and Comment. Two hand-offs give the work to an agent with everything it needs:

  • Fix the checks with an agent… passes the logs of the failing checks.
  • Address the review with an agent… passes the open review comments.

The agent works in the worktree and leaves its changes for you to commit and push. Re-run failed checks starts them again on GitHub.

The merge button offers the methods the repository allows: Squash and merge, Merge commit, Rebase and merge. Auto lets GitHub merge once the checks pass. While checks still run, the confirmation offers Merge anyway. The branch stays until you delete the worktree.

Merge into main… fast-forwards the base to the worktree’s branch without a pull request, then pushes the base to its remote when it has one. It needs a clean, up-to-date branch and a clean main checkout.

Delete worktree in the worktree’s header, or Delete worktree… in a column card’s … menu, opens a sheet that lists:

  • unpushed commits, and an open pull request that stays open on GitHub
  • Discard 3 uncommitted changes, when there are some
  • Clean up: each clean-up step the worktree owes, ticked
  • Delete branch offsite/fix-login-3acea3
  • Also delete it on origin, ticked when the branch’s work is in the base

The branch’s work counts as in the base after a merge commit, a fast-forward, or a squash merge whose changes are all there. A branch with commits the base lacks is deleted only when you tick it, and git keeps those commits until its next garbage collection.

Delete worktree ends the worktree’s sessions and apps, runs the clean-up steps and moves the folder to the worktrees trash, which empties in the background.

Host Settings › Worktrees shows the worktrees folder with its size, and lists:

  • Clean-up suggestions: worktrees whose branch is merged into the base, that never got a commit, or that saw no commit or checkout for 30 days. A worktree with a working agent is left off the list. Tick them, choose Delete their branches too, and delete them in one go.
  • each repository’s setup, with Edit… and Forget
  • Hidden worktrees, with Unhide
  • Leftovers: folders under the worktrees folder that no workspace uses, each with Remove…

Offsite deletes a worktree only when you say so. Counting the space explains the sizes.

The worktree’s agent has tools for every step: worktree_update_from_base, worktree_publish, worktree_create_pr and worktree_merge. Say “publish and open a pull request” or “merge it” and it uses them. It takes these steps when you ask for them, and worktree_merge merges only while no check fails. Deleting the worktree stays with you.