Git Worktree Command Generator

Build git worktree add, list, move, remove, lock, and prune command sequences with branch flags and safe shell quoting.

Private by architecture: All processing is 100% client-side memory. Your data never leaves this browser tab.

Worktree Configuration

Generated Shell Sequence

    About This Tool

    Generates ready-to-run git worktree commands so you can check out multiple branches simultaneously in sibling directories without stashing or cloning the repository twice.

    Supports new branch creation (-b / -B), remote tracking (--track), detached HEAD inspection (--detach), worktree locking (--lock --reason), relocation (move), cleanup (remove / prune), and safe POSIX shell quoting.

    Key Features

    • All 7 git worktree subcommands: Switch between add, list, move, remove, lock, unlock, and prune with context-aware flags.
    • Branch creation & start-point support: Check out an existing branch, create a new branch (-b) from origin/main, reset a branch (-B), or inspect a tag in --detach mode.
    • Post-checkout shell sequence: Optionally append cd and editor launch commands (VS Code, Cursor, Zed) so you can paste one snippet into your terminal.
    • POSIX shell escaping: Automatically quotes paths, branch names, and lock reasons containing spaces or apostrophes.

    Frequently Asked Questions

    Why should I place a new worktree in a sibling directory like ../wt-feature?
    Placing linked worktrees outside the main repository folder (for example ../project-hotfix) prevents untracked directory clutter, avoids IDE indexing duplicates, and keeps build tools from scanning nested node_modules.
    Can two worktrees check out the same branch at the same time?
    By default Git refuses to check out a branch that is already active in another worktree so neither working tree falls out of sync when commits are made. Use --detach to inspect the same commit without locking the branch ref.
    What is the difference between git worktree remove and git worktree prune?
    git worktree remove deletes both the linked working directory and its metadata inside .git/worktrees. If you already deleted the folder manually with rm -rf, run git worktree prune to clean up the orphaned metadata inside .git/worktrees.