Worktrees
How GridTree pairs every branch with its own working directory and terminals.
GridTree is built on a small, deliberate primitive: the git worktree. Every branch you care about gets its own folder and its own terminals, but they all share the same underlying repository.
Why worktrees#
You can keep several branches checked out at once and switch between them instantly, without stashing or losing terminal state. GridTree lists the repository's existing git worktrees and lets you add and remove them from the UI.
Creating a worktree#
Open the new-worktree dialog from the worktree list. You choose:
- Existing branch — check out a local or remote branch into a fresh worktree.
- New branch — create a branch and pick the base branch to fork it from.
By default the worktree folder is created next to your clone, as <repo>.worktrees/<branch>. Use Browse to put it somewhere else, or set a default location per project in settings.
After the worktree is created, GridTree runs your project's post-creation commands (for example installing dependencies) and opens a terminal pane in the new directory.
From an issue or pull request
If you've connected GitHub or Jira, you can create a worktree straight from an issue or PR in the sidebar. GridTree builds the branch name from the issue — for example PROJ-456-add-export — following the branch-name pattern set for that project.
Removing a worktree#
When you're done with a branch, delete its worktree from the worktree menu. GridTree runs git worktree remove to detach it and clean up the folder; if git refuses because the worktree is busy or dirty, you can force the removal.
If a worktree is locked (git marks it locked so it can't be pruned), GridTree can unlock it again from the same menu.