# Lisa Git Prune

> pruning local branches that…

- Skill: `codyswanngt/lisa-git-prune` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add codyswanngt/lisa-git-prune`
- Raw SKILL.md: https://api.skillmd.com/api/skills/codyswanngt/lisa-git-prune/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: codyswanngt (https://skillmd.com/u/codyswanngt)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/codyswanngt/lisa-git-prune

---


# Git Prune Local Branches

Remove local branches whose upstream tracking branches have been deleted on remote.

## Workflow

### Fetch and prune remote-tracking references

!git fetch --prune

### Find and delete stale local branches

!git branch -vv | grep ': gone]' | awk '{print $1}'

### Apply these requirements

1. **Preview**: Show which branches will be deleted before deleting
2. **Safe Delete**: Use `-d` (safe delete) which refuses to delete unmerged branches
3. **Report**: Show summary of deleted branches

### Never

- Force delete (`-D`) without user confirmation
- Delete the current branch
- Delete protected branches (dev, staging, main)

## Execute

Execute the workflow now.

