using-git-worktrees

Create isolated git worktrees with automatic directory selection and safety verification.

7|Updated Jan 27, 2026
One-click install
npx skills add https://github.com/wsxwj123/opencode-skills-backup --skill using-git-worktrees-wsxwj123
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/wsxwj123/opencode-skills-backup/tree/main/using-git-worktrees
Command: npx skills add https://github.com/wsxwj123/opencode-skills-backup --skill using-git-worktrees-wsxwj123

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Starting feature work often requires isolation from the current workspace to avoid conflicts and ensure a clean baseline. This skill creates isolated git worktrees with smart directory selection and safety verification to guarantee safe, repeatable environments.

Core Features & Use Cases

  • Isolated workspaces: create per-feature worktrees that share the same repository but keep changes separated.
  • Safe directory selection: automatically select a local or global worktree location with safety checks.
  • Quick project setup: automatically run setup commands and verify a clean baseline before starting work.

Quick Start

Set up an isolated git worktree for a feature using the recommended local/global directory strategy and safety verification.

Frequently Asked Questions about using-git-worktrees

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create an isolated git workspace for feature development?

To create an isolated git workspace, you can set up a git worktree that shares the same repository while keeping your feature changes separated from the main workspace. This ensures a clean baseline and prevents conflicts during multi-branch workflows.

What is a git worktree and when do I need one for my workflow?

A git worktree is an isolated workspace linked to a single repository that allows safe feature development. You need one when you want to develop features without polluting the main workspace or risking conflicts across different branches.

How do I safely set up a new git worktree without breaking my current repo?

Safely setting up a git worktree involves automatic local or global directory selection with built-in safety checks. This process verifies a clean baseline before creating the worktree, preventing accidental pollution of your main workspace.

Can I automatically run project setup steps after creating a git worktree?

Yes, you can automatically run optional project setup commands immediately after creating the git worktree. This ensures the isolated environment is fully configured and ready for feature work before you start coding.

Is using git worktrees better than stashing changes for multi-branch workflows?

Using git worktrees provides isolated workspaces for each feature, unlike stashing which temporarily shelves changes. Worktrees allow you to maintain multiple branches simultaneously without switching contexts or risking lost work.

Do I need to manually specify the directory location when creating a git worktree?

No, you do not need to manually specify the directory location. The worktree creation process includes smart automatic project-name detection and safe directory selection, choosing either a local or global location based on your setup.