Configuration File
GWTree uses a global configuration file stored at:Open Configuration
Open the config file in your editor:View Configuration Path
If you haveeditor set to none:
Reset Configuration
Reset all settings to defaults:Configuration Schema
The config file contains three main settings:editor
Controls which editor opens after creating a worktree. Type:stringOptions:
"code", "cursor", "default", "none"Default:
"code"
Options
- code
- cursor
- default
- none
Opens worktrees in Visual Studio Code.Runs:Requirements:
- VS Code installed
codecommand in PATH
- Opens each worktree in a new window
- Batch creation opens multiple windows
Skip Editor with Flag
Temporarily skip editor opening without changing config:installDeps
Controls whether dependencies are automatically installed after creating a worktree. Type:booleanDefault:
true
Enable Dependency Installation
- Detects package manager from lockfiles
- Runs install command automatically
- Uses
lastPmas fallback if no lockfile found
Disable Dependency Installation
- Skips installation step entirely
- Faster worktree creation
- Manual installation required
Package Manager Detection
GWTree detects the package manager in this order:- pnpm: If
pnpm-lock.yamlexists - bun: If
bun.lockbexists - yarn: If
yarn.lockexists - npm: If
package-lock.jsonexists - pnpm (default): If only
package.jsonexists - lastPm: If no lockfiles found
Install Commands
| Package Manager | Command |
|---|---|
| pnpm | pnpm install |
| npm | npm install |
| yarn | yarn install |
| bun | bun install |
lastPm
Tracks the last package manager used successfully. Type:string | nullOptions:
"pnpm", "npm", "yarn", "bun", nullDefault:
null
Automatic Updates
This field is automatically updated by GWTree:- GWTree detects the package manager
- Runs the install command
- Updates
lastPmto the detected package manager
Fallback Behavior
When no lockfile is found:- If
lastPmis set: Uses that package manager - If
lastPmisnull: No installation occurs
Manual Configuration
You can manually set a preferred package manager:Configuration Examples
VS Code + Always Install
- Opens worktrees in VS Code
- Installs dependencies automatically
- Prefers pnpm when no lockfile
Cursor + Skip Install
- Opens worktrees in Cursor
- Skips dependency installation
- No package manager fallback
Terminal Vim + NPM
- Opens worktrees in $EDITOR (vim)
- Installs dependencies with npm
- Uses npm when no lockfile
No Editor + Manual Install
- No automatic editor opening
- No automatic dependency installation
- Maximum control, minimum automation
Fast Mode (CI/Scripting)
- No editor opening
- No dependency installation
- Fast worktree creation for scripts
Configuration Workflow
Initial Setup
Common Adjustments
Switch to Cursor
Disable Auto-install for Speed
Prefer Bun
Advanced Configuration
Per-Command Overrides
Config settings can be overridden per command:Team Configuration
For teams, you can share config via documentation:Environment-Specific Config
Development Machine
Remote SSH Session
CI/CD Pipeline
Troubleshooting
Editor Not Opening
Problem: Editor configured but doesn’t open Solutions:- Verify editor is installed
- Check editor command is in PATH:
- Try running command manually:
- Check config file:
Dependencies Not Installing
Problem:installDeps is true but nothing installs
Solutions:
- Check
installDepssetting: - Verify lockfile exists in repo
- Set
lastPmto preferred package manager - Check package manager is installed:
Wrong Package Manager
Problem: Using npm but want pnpm Solutions:- Delete lockfiles from other package managers
- Set
lastPmto preferred: - Ensure lockfile exists:
Config Changes Not Applied
Problem: Edited config but behavior unchanged Solutions:- Verify JSON syntax is valid
- Check no trailing commas
- Restart terminal/shell
- View config path:
- Reset and reconfigure:
Next Steps
- Apply your config by creating worktrees
- Learn about batch creation which respects config settings
- Explore managing worktrees to track your work