Help · Using Morie
Worktrees
Each ticket works in its own copy of the code, so two tickets never edit the same files.
Checked against Morie 0.51.0.
- A worktree is a folder with the ticket’s own branch, made from your repository when the ticket first needs it.
- A ticket’s worktrees are under Ticket info → Worktrees; all of them are in Settings → Repositories and worktrees.
- When a ticket is finished, Settings → Tickets → Finished tickets says whether Morie removes its worktrees, and when.
Tickets #12 and #13 both change shop-web at once. Each has its own folder and branch, and each runs dev on its own port.
- On #12, “Saved carts”, start a chat with shop-web ticked. Morie makes the branch
codex/saved-cartsin the folder~/MorieWork/shop-web-saved-carts. - On #13, “Gift cards”, do the same. It gets
codex/gift-cardsin~/MorieWork/shop-web-gift-cards. Your own shop-web folder is not touched. - In each ticket, open the Terminals picker and press Run on the script
dev. Each worktree has its own port, inMORIE_PORT, so both apps run at once. - Open #12, then Ticket info, then Worktrees. shop-web says Ready with its branch and how many files changed.
What a worktree is
A worktree is a second working folder for the same repository, on its own branch. Your own folder stays as it is. A ticket gets one for every repository it works in, so a chat on #12 and a chat on #13 can both change shop-web without meeting.
Morie makes it when a chat or a terminal first needs it. Starting a chat prepares the worktrees of the repositories ticked in its picker. A chat can work in more than one repository; one is its main folder, marked primary.
Looking at a ticket’s worktrees
Open the ticket, then Ticket info, then Worktrees. Each repository has a row:
- Its state: Ready, Not prepared, Preparing, Archived or Needs recovery.
- Its branch, how many files changed (a link to Git), and its pull request, if there is one.
- A button: Prepare worktree, Restore worktree or Prepare again.
Press the small arrow at the end of a row for its base, branch, path and head. Before a worktree exists, you can pick the base it starts from.
Their names
Settings → Repositories and worktrees → Worktrees and branches names new ones.
- Branch template. The default is
codex/{slug}.{slug}comes from the ticket’s title and is fixed at the first worktree. - Worktree root template. The default is
~/MorieWork/{repo}-{slug}.{repo}is the repository’s short name. A folder under your home survives a restart; one under/private/tmpdoes not.
Each template saves when you press Enter or leave the field. A change applies to new worktrees only. Existing branches and folders stay as they are.
Files chats leave
Settings → Repositories and worktrees → Worktrees and branches → Files chats leave counts the new files a chat wrote and neither committed nor removed, per checkout or worktree. Morie never moves or removes one on its own. Sort them now… shows each file with Choose…: commit it on its branch or in its ticket's worktree, keep it in Morie, move it to the Trash, or leave it. The button counts what will change, and a file that could not be committed is listed with git's reason.
After a ticket is finished
Settings → Tickets → Finished tickets is one card for what happens when a ticket is finished (it moved there from Worktrees and branches and from Project workflow). Each switch saves when you flip it; a switch shows its state and says no words.
- Statuses that clear claims. A claim on a ticket in one of these statuses, or archived, never blocks another ticket.
- Remove finished tickets’ worktrees. On: when a ticket reaches one of the statuses in When a ticket is (or is archived), Morie removes its worktrees without asking. It keeps one with uncommitted files, a chat that is not closed, or a branch not merged, and says why in a note on the ticket.
- Wait first. Off, or a number of days from 1 to 90; a ticket that leaves those statuses meanwhile keeps its worktrees.
- Branches and Rigs. Also delete the branch on this Mac once the default branch has it, and the ticket’s rigs.
- Delete merged branches. Every 24 hours, the branches on this Mac of finished tickets whose worktrees are gone.
Example: tick Done under When a ticket is, set Wait first to 2 days, and move #12 to Done. Two days later its worktree folder is gone, and #12 has a note saying what was removed.
From a chat: settings.read with page Finished tickets (or its old name Project workflow) reads Statuses that clear claims and When a ticket is (the statuses that remove finished tickets' worktrees); they are read only, and a change is refused with the owner's words.
Looking after the disk
All worktrees in this project lists every one, with its size and whether it is merged. Archive frees the folder but keeps the branch, with uncommitted work saved as a commit on it. Ticket info restores it with Restore worktree. Remove deletes the folder and asks you to confirm anything that would be lost.
When something is off
- A repository says Not prepared? Nothing has needed it yet. Start a chat or press Prepare worktree.
- It says Needs recovery? Preparing did not finish. Press Prepare again.
- Disk filling up? Open All worktrees in this project, and archive or remove the merged ones.
See also: Tickets and Ticket info · Checks and scripts