Skip to content
Back to skills

Using Git Worktrees

BSecurity

Use when starting feature work that needs isolation from current workspace or before executing implementation plans

  • 47 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 12, 2026
documentationgogit

Security analysis

B84/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro shows the line behind each finding and how to fix it

Scanned September 12, 2026

npx -y skills add skeletorflet/opencode-supreme-setup --skill using-git-worktrees --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Using Git Worktrees?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Using Git Worktrees
[![Security: B — Skills Directory](https://www.skillsdirectory.com/api/skills/skeletorflet-using-git-worktrees/badge)](https://www.skillsdirectory.com/skills/skeletorflet-using-git-worktrees)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: using-git-worktrees
description: Use when starting feature work that needs isolation from current workspace or before executing implementation plans
---

# Using Git Worktrees

## Overview

Ensure work happens in an isolated workspace. Prefer your platform's native worktree tools. Fall back to manual git worktrees only when no native tool is available.

**Core principle:** Detect existing isolation first. Then use native tools. Then fall back to git.

## Step 0: Detect Existing Isolation
Check if already in an isolated workspace using `git rev-parse --git-dir` and `git rev-parse --git-common-dir`.
If GIT_DIR != GIT_COMMON, you are already in a linked worktree. Skip to project setup.

## Step 1: Create Isolated Workspace
Prefer native worktree tools. Fall back to `git worktree add`.

## Step 3: Project Setup
Auto-detect and run appropriate setup (npm install, cargo build, pip install, etc.).

## Step 4: Verify Clean Baseline
Run tests to ensure workspace starts clean.

## Quick Reference
| Situation | Action |
|-----------|--------|
| Already in linked worktree | Skip creation |
| Native worktree tool available | Use it |
| No native tool | Git worktree fallback |

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.