git-worktree-remove

Remove a git worktree and its local and remote branches.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/srednoff888-art/4 --skill git-worktree-remove
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-worktree-remove
Source: https://github.com/srednoff888-art/4/tree/main/examples/skills/git-worktree-remove
Command: npx skills add https://github.com/srednoff888-art/4 --skill git-worktree-remove

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Safely remove a git worktree along with its branches and related references, preventing accidental data loss and stale references.

Core Features & Use Cases

  • Enforces safety checks to protect main branches.
  • Removes the worktree, local branch, and remote branch when confirmed.
  • Prunes stale references and reminds about related database cleanup.

Quick Start

Execute the command git-worktree-remove feat/auth to remove the specified worktree.

Frequently Asked Questions about git-worktree-remove

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I safely remove a git worktree and its branches?

To safely remove a git worktree, you execute a teardown command that enforces safety checks to protect main branches before deleting local and remote branches. This prevents accidental data loss during feature work cleanup.

What is the best way to clean up stale git worktree references?

The best way to clean up stale git worktree references is to use a structured removal process that prunes references automatically after deleting the worktree and its associated branches. This ensures your development environment remains clean.

Does removing a git worktree also delete local and remote branches?

Yes, removing a git worktree can delete local and remote branches when confirmed. The process applies safety checks first to prevent accidental deletion of main branches before removing the specified feature branches.

Why does git worktree cleanup require database cleanup reminders?

Git worktree cleanup requires database cleanup reminders because feature work environments often create related database entries that persist after worktree removal. Reminding users prevents stale data from accumulating in the database.

When should I not use an automated git worktree removal process?

You should not use an automated git worktree removal process when working directly on main branches, as the safety checks are designed to protect them. If your worktree contains uncommitted changes, bypassing checks risks data loss.