# Wt

Create a git worktree in worktree/ subdirectory with up-to-date master

- Repository: https://github.com/homeassistant-ai/ha-mcp (5395 stars)
- Category: Git and review
- License: MIT
- Last updated: 2026-11-01
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add homeassistant-ai/ha-mcp --skill wt -g -a claude-code -y`
Codex: `npx skills add homeassistant-ai/ha-mcp --skill wt -g -a codex -y`
Cursor: `npx skills add homeassistant-ai/ha-mcp --skill wt -g -a cursor -y`
Gemini CLI: `npx skills add homeassistant-ai/ha-mcp --skill wt -g -a gemini-cli -y`

## Description

Create a git worktree in worktree/ subdirectory with up-to-date master

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Create Git Worktree

Create a new worktree in `worktree/<branch-name>` with branch `<branch-name>`.

## Execution

```bash
# Return to repo root
cd "$(git rev-parse --show-toplevel)"

# Pull latest master
git checkout master
git pull origin master

# Create worktree
git worktree add worktree/"$ARGUMENTS" -b "$ARGUMENTS"

# Initialize submodules (skills-vendor)
git -C worktree/"$ARGUMENTS" submodule update --init --recursive

# Navigate to worktree
cd worktree/"$ARGUMENTS"

# Confirm location and branch
echo ""
echo "✅ Worktree created and ready:"
echo "   Location: $(pwd)"
echo "   Branch: $(git rev-parse --abbrev-ref HEAD)"
echo ""
echo "You can now work in this isolated environment."
```

## Notes

- Worktree inherits `.claude/skills/` workflows
- To remove when done: `cd ../.. && git worktree remove worktree/"$ARGUMENTS"`
- List all worktrees: `git worktree list`

