Clean up remote git branches that have been merged into origin/main. Use when: (1) User says 'prune remote branches' or 'clean remote branches', (2) User wants to delete only remote merged branches without touching local.
Scanned 9/8/2026
Install to Claude Code
npx -y skills add Takazudo/claude-resources --skill git-prune-branches-remote --agent claude-codeInstalls into .claude/skills of the current project.
Are you the author of Git Prune Branches Remote?
Add the live security badge to your README — it updates automatically with every re-scan.
[](https://www.skillsdirectory.com/skills/takazudo-git-prune-branches-remote)More formats (shields.io, HTML) on the badges page.
---
name: git-prune-branches-remote
description: >-
Clean up remote git branches that have been merged into origin/main. Use when: (1) User says
'prune remote branches' or 'clean remote branches', (2) User wants to delete only remote merged
branches without touching local.
---
# Git Prune Branches (Remote)
Check and prune remote branches that have been merged:
1. Fetch the latest remote information using `git fetch --prune`
2. Get the list of all remote branches using `git branch -r`
3. For each remote branch, check if it has been merged into the remote main branch using `git branch -r --merged origin/main` (or appropriate main branch)
4. Exclude protected branches (main, master, develop, etc.)
5. Create a list of remote branches that are safe to delete
6. Present the deletion list to the user clearly
7. Ask for confirmation: "The following remote branches will be deleted. Proceed? (yes/no)"
8. If user confirms with "yes" or similar affirmative response, delete the remote branches using `git push origin --delete <branch-name>` for each branch
9. Report the results
**Important:** Never delete:
- Protected branches: main, master, develop, development, staging, production
- Branches that are not fully merged (unless explicitly requested)
**Note:** This operation affects the remote repository and cannot be easily undone. Ensure user confirmation before proceeding.
Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.
No comments yet. Be the first to comment!