When to use a worktree
A Git worktree is a second checkout of the same repository on its own branch. Use one when you want two threads to change code at the same time, or want to keep an agent's changes away from the files you are editing. Each thread then edits its own files, and its diff, branch and pull request stay its own.
Create a worktree
Creating a worktree only sets up the checkout. Nothing starts working in it until you start a thread or terminal there.
- Open the Worktrees tool from the strip beside the sidebar.
- Choose New worktree.
- Enter a Branch name, such as
feature/onboarding. The branch starts from the workspace's current HEAD. - Choose Create worktree. It appears in the list with its branch and folder.
Outside your repository
Nora creates managed worktrees under ~/.nora/projects/, so they never show up as untracked files in your project.
Start a thread in a worktree
You can also choose a checkout when you start any thread: click the branch at the bottom of the composer and pick it under Registered checkouts. The branch control only offers a choice when the workspace has more than one checkout.
- In the Worktrees tool, open the worktree's … menu.
- Choose New thread. The new thread screen opens on that worktree.
- Write your message and send it.
Open a pull request from a worktree
When a thread has finished its work in a worktree:
- Open Thread details at the top right of the thread.
- Check Branch changes, and choose View diff to read the full diff against your default branch.
- Choose Create PR (GitHub) or Create MR (GitLab). Nora pushes from the thread's own worktree.
See the status in the list
Once the branch has a pull request, the Worktrees tool shows its status as a coloured dot on the worktree's row.
Check out a worktree's branch
Choose Check out on a worktree's row to check out its branch in the root project.
Delete a worktree
Delete a worktree when its work is merged or no longer needed.
- Remove any agents and terminals attached to it.
- In the Worktrees tool, click the bin on its row, or choose Delete worktree from its … menu.
Can't delete it?
Delete stays disabled while anything is attached to the worktree. Hover the bin to see why.