git-worktree-remove
Installation
SKILL.md
Git Worktree Remove
Safely remove a single git worktree with branch cleanup, merge verification, and database branch teardown.
Core principle: Safety checks first, then clean removal of worktree + branch + DB resources.
Part of: Worktree Lifecycle Suite | /git-worktree | /git-worktree-status | /git-worktree-clean
Process
- Validate Target: Identify worktree to remove
- Safety Check: Protect main/develop branches
- Check Merge Status: Warn if branch has unmerged changes
- Check Uncommitted Changes: Warn if worktree has dirty state
- Remove Worktree:
git worktree remove - Delete Local Branch:
git branch -d(or-Dwith confirmation) - Delete Remote Branch:
git push origin --delete(with confirmation) - Database Cleanup Reminder: Suggest DB branch deletion if applicable
- Prune References:
git worktree prune