git-prune

Delete local Git branches removed from the remote repository.

3|3|Updated Jan 18, 2026
One-click install
npx skills add https://github.com/CodySwannGT/lisa --skill git-prune
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-prune
Source: https://github.com/CodySwannGT/lisa/tree/main/plugins/lisa/skills/git-prune
Command: npx skills add https://github.com/CodySwannGT/lisa --skill git-prune

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps maintain a clean local Git repository by automatically identifying and removing branches that have already been deleted on the remote.

Core Features & Use Cases

  • Remote Sync: Fetches the latest changes from all remotes to ensure accurate branch status.
  • Stale Branch Detection: Identifies local branches whose upstream counterparts no longer exist.
  • Safe Deletion: Uses safe deletion flags to prevent accidental removal of unmerged or critical branches.
  • Use Case: After a team merges several feature branches and deletes them from the remote repository, this Skill can be used to clean up your local environment, removing those now-obsolete local branches.

Quick Start

Execute the git-prune skill to clean up local branches that are no longer on the remote.

Frequently Asked Questions about git-prune

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

FAQPage Schema
How do I clean up stale local git branches after they are deleted on the remote?

To clean up stale local git branches, this Skill fetches remote updates, identifies branches whose upstream counterparts no longer exist using `git branch -vv`, and safely deletes them with user confirmation.

Is there a safe way to delete local git branches without removing unmerged work?

Safe deletion of local git branches is supported by using safe deletion flags, which prevent the accidental removal of unmerged, critical, or currently checked-out branches during the cleanup process.

What is the best way to sync local git branches with deleted remote branches?

The best way to sync local git branches with deleted remotes is fetching latest changes from all remotes to ensure accurate branch status, then pruning local branches that no longer have upstream counterparts.

Does git prune protect the current branch from being removed?

Git prune includes protection against force deletion and prevents the removal of the current branch, ensuring your active working branch is safe during the stale branch cleanup process.

Why do my local git branches remain after the remote repository deletes them?

Local git branches remain because Git does not automatically delete local copies when the remote counterpart is removed, requiring a manual fetch and prune process to identify and clean them up.