clean

Clean up merged branches locally and on remote, keeping only main, dev, and gh-pages.

Content Preview
---
description: Clean up merged branches locally and on remote, keeping only main, dev, and gh-pages.
---

Clean up stale branches that have been merged or are no longer needed.

## Steps

1. **List local branches** to delete (excluding `main`, `dev`, `gh-pages`):

```bash
git branch | grep -v -E '^\*|main$|dev$|gh-pages$'
```

Report what will be deleted. If no branches found, say "No local branches to clean" and skip to step 3.

2. **Delete local branches** that are fully merged:

```bash
git
How to Use

Recommended: Install to project (local)

mkdir -p .claude/skills
curl -o .claude/skills/clean.md \
  https://raw.githubusercontent.com/alirezarezvani/claude-skills/main/.claude/commands/git/clean.md

Skill is scoped to this project only. Add .claude/skills/ to your .gitignoreif you don't want to commit it.

Alternative: Clone full repo

git clone https://github.com/alirezarezvani/claude-skills

Then reference at .claude/commands/git/clean.md

Related Skills