using-git-worktrees

Create isolated Git worktrees with safety verification and dependency setup.

Updated Oct 28, 2025
One-click install
npx skills add https://github.com/AlabamaMike/copilot-agents --skill using-git-worktrees-alabamamike
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/AlabamaMike/copilot-agents/tree/main/.codex/superpowers/skills/using-git-worktrees
Command: npx skills add https://github.com/AlabamaMike/copilot-agents --skill using-git-worktrees-alabamamike

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Developers often need to work on multiple features or bug fixes simultaneously without interfering with their main branch or other ongoing work. Git worktrees provide isolated environments, but setting them up correctly and safely can be complex, especially ensuring .gitignore is updated and project dependencies are installed. This skill automates that setup, preventing accidental commits and ensuring a clean, ready-to-use workspace.

Core Features & Use Cases

  • Automated Worktree Creation: Creates isolated Git worktrees for new features or bug fixes.
  • Safety Verification: Automatically checks and updates .gitignore to prevent accidental commits of worktree contents.
  • Project Setup Automation: Detects and runs common dependency installations (npm, cargo, pip, poetry, go mod).
  • Use Case: Before starting a new feature, use this skill to create a clean, isolated worktree, ensuring your main branch remains untouched and your development environment is ready with all dependencies installed.

Quick Start

Use the using-git-worktrees skill to create a new worktree for the 'feature/new-dashboard' branch.

Frequently Asked Questions about using-git-worktrees

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

FAQPage Schema
How do I work on multiple git branches simultaneously without switching back and forth?

Git worktrees create isolated environments for each branch, letting you work on multiple features concurrently. This skill automates worktree creation, detects your project type, installs dependencies automatically, and updates `.gitignore` to prevent accidental commits, so each workspace is ready to use immediately.

What's the safest way to set up a new git worktree for feature development?

This skill creates isolated worktrees with built-in safety checks: it automatically updates `.gitignore` to exclude worktree contents, runs project setup (npm, cargo, pip, poetry, go mod detection), validates baselines with tests, and verifies the environment before you start coding.

Can I keep my main branch untouched while working on a new feature?

Yes. Git worktrees isolate feature work in separate directories linked to different branches. This skill creates these worktrees with automatic dependency installation and `.gitignore` updates, ensuring your main branch remains clean and unaffected by development work.

How do I avoid committing worktree files to my repository by mistake?

This skill automatically checks and updates your `.gitignore` during worktree creation to prevent accidental commits of worktree contents, securing your repository structure before development begins.

Does setting up a git worktree require manual dependency installation?

No. This skill detects your project's dependency manager—npm, cargo, pip, poetry, or go mod—and installs dependencies automatically during worktree creation, so your isolated workspace is ready without extra setup steps.

What happens after a git worktree is created—is it ready to use immediately?

Yes. This skill creates the worktree, runs automatic project setup, validates baseline tests, and ensures all dependencies are installed, so your isolated workspace is ready for feature development without additional configuration.