Using Git Worktrees

🌐Community
by obra · vlatest · Repository

Efficiently manage multiple parallel development branches using Git worktrees to isolate changes and streamline workflows.

Install on your platform

We auto-selected Claude Code based on this skill’s supported platforms.

1

Run in terminal (recommended)

terminal
claude mcp add using-git-worktrees npx -- -y @trustedskills/using-git-worktrees
2

Or manually add to ~/.claude/settings.json

~/.claude/settings.json
{
  "mcpServers": {
    "using-git-worktrees": {
      "command": "npx",
      "args": [
        "-y",
        "@trustedskills/using-git-worktrees"
      ]
    }
  }
}

Requires Claude Code (claude CLI). Run claude --version to verify your install.

About This Skill

What it does

The using-git-worktrees skill enables AI agents to manage multiple Git branches within a single repository using Git worktrees. This allows users to checkout and switch between different branches without needing to commit changes or switch directories, streamlining workflows for developers working on parallel features or bug fixes.

When to use it

  • You need to work on multiple branches simultaneously in the same project.
  • You want to test changes from one branch while actively developing on another.
  • Your workflow requires frequent switching between feature branches without losing context.

Key capabilities

  • Checkout and manage multiple Git branches in parallel.
  • Avoid conflicts by isolating branch-specific changes.
  • Simplify development workflows for complex projects with many features.

Example prompts

  • "Set up a worktree for the 'feature-login' branch so I can test it alongside my current work."
  • "Create a new worktree for the 'bugfix-ui' branch and switch to it."
  • "Show me how to list all active Git worktrees in this repository."

Tips & gotchas

  • Ensure your Git version is 2.23 or newer, as worktrees require this feature.
  • Worktrees are tied to specific branches; avoid using them for unrelated tasks to prevent confusion.

Tags

🛡️

TrustedSkills Verification

Unlike other registries that point to live repositories, TrustedSkills pins every skill to a verified commit hash. This protects you from malicious updates — what you install today is exactly what was reviewed and verified.

Security Audits

Gen Agent Trust HubPass
SocketPass
SnykPass

Details

Version
vlatest
License
Author
obra
Installs
12.9k

🌐 Community

Passed automated security scans.