Remove git worktrees from .worktrees/ directory and clean up all traces. Use this when the user wants to delete a worktree they no longer need, with interactive selection if no worktree name is provided.
This skill removes git worktrees from the .worktrees/ directory and ensures all traces are completely cleaned up. It can remove a specific worktree by name or present an interactive selection menu when no name is provided.
Use this skill when the user needs to:
The skill uses a bash script (scripts/remove_worktree.sh) that:
/ with -) to match git-worktree-create behavior.worktrees/ directory existsgit worktree remove --force.worktrees/ directory if it becomes emptyscripts/remove_worktree.sh <worktree-name>
Examples:
# Remove worktree by directory name
scripts/remove_worktree.sh hotfix-123
# Remove worktree using original branch name (will be auto-sanitized)
scripts/remove_worktree.sh user.name/AOF-123
# This will remove: .worktrees/user.name-AOF-123
# Both approaches work the same:
scripts/remove_worktree.sh feature/new-feature
scripts/remove_worktree.sh feature-new-feature
scripts/remove_worktree.sh
This will display a numbered list of available worktrees and prompt you to select one.
When called without arguments, the script displays:
No worktree name provided. Available worktrees:
[1] feature-branch
[2] hotfix-123
[3] bugfix-456
Select worktree to remove (number or name):
You can respond with either:
2)hotfix-123)--force flag to handle worktrees with uncommitted changesThe script ensures no traces remain by:
.worktrees/<worktree-name>).worktrees/ directory if emptyThe script will error if:
.worktrees/ directory exists# User has finished work on hotfix-123 worktree
$ scripts/remove_worktree.sh hotfix-123
⚠️ About to remove worktree: .worktrees/hotfix-123
Are you sure? (y/N): y
Removing worktree...
✅ Worktree removed successfully
Pruning worktree administrative data...
✅ Worktree 'hotfix-123' has been completely removed
All traces of the worktree have been cleaned up.
npx skills add alex-popov-tech/git-worktree-remove下载完整 Skill 目录,包含 SKILL.md 及所有相关文件
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer