A simple CLI tool for managing git worktrees. Create isolated worktrees with automatic environment setup—perfect for running multiple AI coding assistants on different branches simultaneously.
Git worktrees let you have multiple branches checked out at once in separate directories. Grove makes this effortless:
- Parallel AI sessions: Run Claude Code, Cursor, or Copilot on different features at the same time
- Zero-stash workflow: Start a bugfix without stashing your current work
- Automatic setup: Copies your
.envfiles and installs dependencies - Smart detection: Auto-detects npm, pnpm, yarn, or bun
curl -fsSL https://raw.githubusercontent.com/donkoko/grove/main/install.sh | bashHomebrew support coming soon.
After installation, enable the shell integration to automatically cd into new worktrees:
Zsh:
echo -e '\n# Grove - git worktree tool\nsource /usr/local/share/grove/integrations/grove.zsh' >> ~/.zshrc && source ~/.zshrcBash:
echo -e '\n# Grove - git worktree tool\nsource /usr/local/share/grove/integrations/grove.bash' >> ~/.bashrc && source ~/.bashrcYou can use either gwt or grove as the command name—they are interchangeable.
# Checkout an existing branch
gwt feature/auth # → .worktrees/auth
# Custom folder name
gwt feature/auth -f login # → .worktrees/login
# Create a new branch from main
gwt -n feature/new-thing # → .worktrees/new-thing
# Create a new branch from specific base
gwt -n feature/new-thing develop # → .worktrees/new-thing (from develop)
# Skip dependency installation
gwt feature/auth -s
gwt feature/auth --skip| Flag | Description |
|---|---|
-n |
Create a new branch instead of checking out existing |
-f <name> |
Custom folder name (default: branch name without prefix) |
-l, --link |
Symlink env files instead of copying |
-s, --skip |
Skip dependency installation |
-h, --help |
Show help message |
-v, --version |
Show version |
Set these environment variables in your shell config:
# Change worktrees directory (default: .worktrees)
export GWT_DIR=".trees"
# Change which env files get copied (default: .env .env.local)
export GWT_ENV_FILES=".env .env.local .env.development"
# Always skip dependency installation (default: 0)
export GWT_SKIP_INSTALL=1
# Always symlink env files instead of copying (default: 0)
export GWT_LINK_ENV=1
# Copy additional files/folders to each worktree
export GWT_COPY_PATHS=".cert .config/local"When you run gwt feature/auth:
- Creates
.worktrees/authwith that branch checked out - Adds
.worktrees/to.gitignore(if not already there) - Copies your
.envfiles from the main repo (use-lto symlink instead) - Switches to your nvm default node version (if using nvm)
- Runs
npm install(or pnpm/yarn/bun based on lockfile) - cd's you into the new worktree (if shell integration is enabled)
All worktrees share the same .git history, so commits in one are immediately visible in others.
| Command | Description |
|---|---|
gwt list |
List all worktrees |
gwt remove |
Interactively multi-select worktrees to remove |
gwt remove <name...> |
Remove one or more worktrees by name |
gwt remove <name...> --force |
Force remove dirty worktrees |
gwt update |
Update grove to the latest version |
gwt help |
Show help message |
# Start in your main repo (stays on main)
cd ~/projects/my-app
# Terminal 1: Start Claude Code on a feature
gwt -n feature/new-api
claude
# Terminal 2: Start another session on a bugfix
cd ~/projects/my-app
gwt bugfix/login-issue
claude
# Both work in parallel without conflicts!my-app/
├── .git/
├── .gitignore # Grove adds .worktrees/ here
├── .worktrees/ # Your worktrees live here
│ ├── feature-a/ # Each is a full working copy
│ ├── bugfix-123/
│ └── experiment/
├── .env # Copied into each worktree
├── .env.local
└── src/
curl -fsSL https://raw.githubusercontent.com/donkoko/grove/main/uninstall.sh | bashDon't forget to remove the source line from your shell config.
MIT
Grove is made for developers who juggle multiple tasks. Happy hacking! 🌳