using-git-worktrees

Create isolated git worktrees for feature branches without affecting the main repository.

Updated Jul 8, 2022
One-click install
npx skills add https://github.com/limaon/dotfiles --skill using-git-worktrees-limaon
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/limaon/dotfiles/tree/main/.config/opencode/skills/using-git-worktrees
Command: npx skills add https://github.com/limaon/dotfiles --skill using-git-worktrees-limaon

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps engineers establish isolated git worktrees to protect the main repository while they develop features or run experiments in parallel.

Core Features & Use Cases

  • Priority-based directory selection: uses a defined order to locate or propose a worktree location.
  • Safety verification: ensures new worktrees are ignored by git before creation to prevent accidental commits.
  • Auto-setup & project awareness: auto-detects project context and runs initial setup commands when a new worktree is created.
  • Use Case: start feature work on a new branch without affecting the current workspace, or experiment with different branch states in isolation.

Quick Start

  1. Review current repository state and ensure git is available.
  2. Run the command or invoke the skill to create a new isolated worktree for your feature branch.
  3. Begin development inside the new worktree and validate changes before merging.

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 worktree for feature development?

To create an isolated git worktree, the skill auto-detects your project context, selects a directory, verifies ignore rules, and sets up the worktree with initial commands to isolate feature work from the main repository.

What is a git worktree used for in multi-branch workflows?

A git worktree is used to isolate feature development and experimentation in parallel multi-branch workflows, preserving the primary working directory by preventing accidental commits to the main repository.

How can I ensure a new git worktree is ignored from accidental commits?

You can ensure a new git worktree is ignored by using safety verification features that check git ignore rules before creation, preventing the isolated worktree from accidentally entering the main repository.

Do I need external libraries to set up git worktrees automatically?

You do not need external libraries to set up git worktrees automatically; the solution relies solely on standard git worktree features and commands to detect context, verify safety, and run initial setups.

What is the best way to manage multiple git branches without affecting my current workspace?

The best way to manage multiple branches without affecting your workspace is creating isolated git worktrees, which allow you to experiment with different branch states safely and run initial setup commands automatically.