Skip to main content

Requirements

GWTree requires Node.js 18.0.0 or higher.
Make sure you have git installed and are working within a git repository.

Install globally

Install GWTree globally to use the gwt command anywhere:
npm install -g gwtree

Verify installation

Check that GWTree is installed correctly:
gwt --version
# Output: 2.0.0
You can also use the full command gwtree instead of the gwt alias.

First-time setup

On first run, GWTree creates a config file at ~/.config/gwtree/config.json with default settings:
{
  "editor": "code",
  "installDeps": true,
  "lastPm": null
}

Configuration options

editor
string
default:"code"
Editor to open worktrees in: code, cursor, default (uses $EDITOR), or none
installDeps
boolean
default:"true"
Automatically install dependencies when creating worktrees
lastPm
string
default:"null"
Last used package manager: pnpm, npm, yarn, bun, or null

Manage configuration

Open the config file in your editor:
gwt config
Reset to default settings:
gwt config reset

Uninstall

To remove GWTree:
npm uninstall -g gwtree
Configuration files in ~/.config/gwtree/ and worktree records in ~/.gwtree/ will remain after uninstall. Delete these directories manually if needed.

Next steps

Quickstart

Create your first worktree and learn the essential commands