Skip to content

Worktrees

Worktrees let you work on multiple stacks in parallel, each in its own directory. Instead of stashing changes or juggling branches, you can have separate working directories for different features.

When to Use Worktrees

Worktrees are ideal when you need to:

  • Work on multiple features simultaneously — Switch between projects without stashing
  • Review code while continuing development — Keep your work-in-progress separate from the PR you're reviewing
  • Run long CI validation — Test changes in an isolated directory while working elsewhere
  • Build on someone else's stack — Checkout a teammate's PR without affecting your main workspace

For single-feature development, the standard single-directory workflow is simpler.

Quick Start

# Create a worktree and open it
stackit worktree create my-feature --open

# You're now in ../your-repo-stacks/my-feature/
# Create branches as usual
git add feature.go
stackit create add-feature -m "feat: add new feature"
  • Getting Started


    Create your first worktree, understand the basics, and learn different creation methods.

    Getting started →

  • Shell Integration


    Enable automatic directory changes when opening or creating worktrees.

    Shell integration →

  • Management


    List, open, remove worktrees. Configure base paths, auto-cleanup, and post-create hooks.

    Management →

Key Commands

Command Description
stackit worktree create <name> Create a new worktree
stackit worktree open <name> Open an existing worktree
stackit worktree list List all worktrees
stackit worktree remove <name> Remove a worktree