Git Worktree

🌐Community
by everyinc · vlatest · Repository

Manage multiple parallel Git branches effortlessly using worktrees to isolate development without impacting your main repository.

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 git-worktree npx -- -y @trustedskills/git-worktree
2

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

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

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

About This Skill

What it does

This skill enables AI agents to manage multiple working directories within a single Git repository simultaneously. It allows for parallel experimentation and development without modifying the primary branch or requiring frequent cloning of the entire codebase.

When to use it

  • Parallel Feature Development: Test multiple feature branches against the same base code without merging conflicts.
  • Isolated Experimentation: Create temporary worktrees to experiment with risky changes that can be easily discarded if they break the build.
  • Multi-Environment Support: Maintain separate environments (e.g., dev, staging) pointing to different commits of the same repository.
  • Code Review Workflow: Inspect specific branches or tags in an isolated directory without affecting your current working tree.

Key capabilities

  • Creates additional working directories linked to the same Git repository database.
  • Supports multiple heads (branches or tags) within a single worktree.
  • Allows independent commits and changes per worktree without interfering with others.
  • Integrates seamlessly with standard Git commands like checkout, commit, and push.

Example prompts

  • "Create a new worktree named 'feature-auth' based on the current HEAD to implement login logic."
  • "Set up two worktrees: one tracking the 'main' branch for daily tasks and another on 'release-v2' for hotfixes."
  • "Switch to an existing worktree called 'experiment-db-migration' and run the migration script."

Tips & gotchas

Ensure you have write permissions to the parent directory where worktrees will be created, as they are stored there. Remember that changes in one worktree do not automatically appear in others; explicit commits and pushes are required for each branch.

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
everyinc
Installs
177

🌐 Community

Passed automated security scans.