Git Delete Branch

Delete local and remote Git branches with merged and force checks.

1|1|Updated Feb 21, 2026
One-click install
npx skills add https://github.com/dtsong/claude-code-windows-setup --skill git-delete-branch
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Git Delete Branch
Source: https://github.com/dtsong/claude-code-windows-setup/tree/main/skills/git-workflows/skills/delete-branch
Command: npx skills add https://github.com/dtsong/claude-code-windows-setup --skill git-delete-branch

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill helps you safely delete local and remote Git branches, preventing accidental data loss and cleaning up your repository.

Core Features & Use Cases

  • Safe Deletion: Automatically checks if a branch is merged before deletion.
  • Remote Deletion: Option to delete the corresponding remote branch.
  • Batch Deletion: Cleans up multiple merged or stale branches at once.
  • Use Case: After a feature branch has been merged into main via a pull request, use this Skill to remove both the local and remote branches to keep your repository tidy.

Quick Start

Use the git delete branch skill to delete the local branch named 'feature/old-login'.

Frequently Asked Questions about Git Delete Branch

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

FAQPage Schema
How do I safely delete Git branches without losing unmerged changes?

To safely delete Git branches, this Skill automatically checks if a branch is merged before removal and prompts for user confirmation, preventing accidental data loss. For unmerged branches, it supports a force deletion option to override the safety check.

What is the best way to clean up multiple stale Git branches at once?

The best way to clean up stale Git branches is using a batch deletion process. This Skill identifies and removes multiple merged or stale branches simultaneously, ensuring repository hygiene without requiring individual branch deletion commands.

Can I delete both local and remote Git branches at the same time?

Yes, you can delete both local and remote Git branches simultaneously. This Skill includes an option to delete the corresponding remote branch during the local cleanup process, synchronizing your repository across local and remote environments.

Do I need the Git command-line interface to delete remote branches?

Yes, you need the Git command-line interface installed to delete remote branches. This Skill requires the command-line environment to execute branch manipulation and remote synchronization commands for safe local and remote deletion.

When should I not use force deletion for unmerged Git branches?

You should avoid force deletion for unmerged Git branches when the commits contain unique work not present in your main branch. Because force deletion bypasses safety checks, using it on unmerged branches will permanently destroy any uncommitted or unmerged data.