using-git-worktrees

Create isolated Git worktrees with automated setup and baseline testing.

Updated Oct 21, 2022
One-click install
npx skills add https://github.com/Chengxufeng1994/dotfiles --skill using-git-worktrees-chengxufeng1994
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/Chengxufeng1994/dotfiles/tree/main/gemini/antigravity/global_skills/using-git-worktrees
Command: npx skills add https://github.com/Chengxufeng1994/dotfiles --skill using-git-worktrees-chengxufeng1994

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps you create isolated Git worktrees for new feature development, preventing conflicts with your current workspace and ensuring a clean starting point for implementation.

Core Features & Use Cases

  • Isolated Workspaces: Work on multiple branches simultaneously without context switching.
  • Smart Directory Selection: Automatically finds or prompts for the best location to create worktrees.
  • Safety Verification: Ensures project-local directories are ignored by Git before creation.
  • Automated Setup: Runs project-specific setup commands (npm, cargo, pip, poetry, go).
  • Baseline Testing: Verifies a clean state by running tests after setup.
  • Use Case: When starting a new feature like "user authentication," this skill will set up a dedicated directory for it, install dependencies, and confirm tests pass before you begin coding.

Quick Start

Use the using-git-worktrees skill to set up an isolated workspace for the 'new-feature' 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 create an isolated Git worktree for feature development?

To create an isolated Git worktree, the skill manages directory selection and safety verification to ensure project-local paths are ignored. It sets up an isolated workspace for your new feature branch, preventing conflicts with your current development environment.

How do I manage dependencies when switching to a new Git branch?

Managing dependencies for a new Git branch is automated by detecting and running project-specific installation commands. The skill supports Node.js, Rust, Python, and Go projects by executing relevant build commands like npm, cargo, pip, or go.

Does Git worktree setup work with Rust and Python projects?

Yes, Git worktree setup works with Rust and Python projects by detecting and running relevant installation commands. It supports Node.js, Rust, Python, and Go environments, executing tools like cargo, pip, and poetry to automate project setup.

Why does my Git worktree include files from the main workspace?

Files from the main workspace appear in your Git worktree if project-local directories are not ignored. The skill performs safety verification to ensure local directories are properly excluded by Git before creating the isolated worktree.

What is the best way to verify a clean baseline before coding a new feature?

The best way to verify a clean baseline is to run tests after automated project setup. The skill performs baseline testing by executing your test suite immediately after installing dependencies, confirming a clean state before you begin coding.