git-local-branch-cleaning
Clean up local branches that are no longer needed by running the bundled script.
Workflow
Run the cleanup script:
bash <base_directory>/scripts/clean-branches.sh
Where <base_directory> is the path shown in "Base directory for this skill:" at the top of the skill invocation.
The script will:
- Fetch and prune remote tracking refs
- Find branches in any of these states:
- Fully merged into
main - Remote tracking ref gone (remote branch was deleted)
- Corresponding PR is merged or closed (requires
ghCLI)
- Fully merged into
- Display the list of candidate branches and ask for confirmation
- Delete confirmed branches locally with
git branch -d/git branch -Dand remove the matching remote branch if it still exists - Report what was deleted and what was skipped