Using Git Worktrees
Enables parallel experimentation using Git worktrees within LGBARN's backend for efficient model training and version control.
Install on your platform
We auto-selected Claude Code based on this skill’s supported platforms.
Run in terminal (recommended)
claude mcp add lgbarn-using-git-worktrees npx -- -y @trustedskills/lgbarn-using-git-worktrees
Or manually add to ~/.claude/settings.json
{
"mcpServers": {
"lgbarn-using-git-worktrees": {
"command": "npx",
"args": [
"-y",
"@trustedskills/lgbarn-using-git-worktrees"
]
}
}
}Requires Claude Code (claude CLI). Run claude --version to verify your install.
About This Skill
What it does
This skill enables an AI agent to utilize Git worktrees, allowing developers to checkout multiple branches of a repository simultaneously within the same working directory. It facilitates efficient development workflows by enabling parallel tasks and experimentation without constantly switching between full repositories. The agent can create, list, enter, and remove worktrees as needed.
When to use it
- Parallel Feature Development: A developer needs to work on two features concurrently from separate branches of a Git repository.
- Experimentation & Bug Fixes: An AI agent is tasked with testing different approaches or bug fixes without disrupting the main development branch.
- Reviewing Pull Requests: Quickly checkout and inspect a pull request's branch alongside your current working copy for easier comparison.
- Reproducing Issues: Create a worktree to isolate and reproduce a specific issue reported from a particular Git commit or branch.
Key capabilities
- Creating new worktrees
- Listing existing worktrees
- Entering an active worktree
- Removing worktrees
Example prompts
- "Create a worktree named 'feature-x' from the 'develop' branch."
- "List all available Git worktrees."
- "Switch to the worktree called 'bugfix-123'."
- “Remove the worktree ‘experimental-branch’.”
Tips & gotchas
- Ensure Git is installed and configured correctly on the system where the AI agent operates.
- Worktrees are essentially independent copies of a branch; changes within one do not automatically affect others unless explicitly merged.
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 Hub | Pass |
| Socket | Pass |
| Snyk | Pass |
🌐 Community
Passed automated security scans.