sync-branches

Delete local and remote Git branches merged into upstream/dev.

130|21|Updated Jun 29, 2023
One-click install
npx skills add https://github.com/indexnetwork/index --skill sync-branches
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sync-branches
Source: https://github.com/indexnetwork/index/tree/main/.cursor/skills/sync-branches
Command: npx skills add https://github.com/indexnetwork/index --skill sync-branches

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill automates the cleanup of local and remote Git branches that have been merged into the main development branch, preventing clutter and improving repository management.

Core Features & Use Cases

  • Detects Merged Branches: Identifies branches that are fully merged into upstream/dev.
  • Deletes Local Branches: Safely removes merged branches from your local repository.
  • Deletes Remote Branches: Cleans up corresponding branches on the origin remote.
  • Optional Closed PR Branch Cleanup: Can be configured to remove branches associated with closed (but not necessarily merged) Pull Requests.
  • Use Case: After merging a feature branch into dev, you can use this skill to automatically delete both your local copy and the remote branch, keeping your repository tidy.

Quick Start

Use the sync-branches skill to clean up all branches merged into upstream/dev.

Frequently Asked Questions about sync-branches

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

FAQPage Schema
How do I clean up merged Git branches automatically?

To automate Git branch cleanup, you can use a skill that detects branches merged into upstream/dev and deletes them from both your local repository and the remote origin. This prevents clutter by safely removing branches that are no longer needed.

Can I delete branches from closed Pull Requests without merging them?

Yes, you can delete branches from closed Pull Requests without merging them by enabling optional closed PR branch cleanup. This removes leftover branches associated with closed but not necessarily merged PRs, keeping your local and remote origin repository tidy.

Does Git branch cleanup protect main and dev branches from deletion?

Git branch cleanup protects main, master, and dev branches from deletion by explicitly excluding them as protected branches. This ensures your core development branches remain intact while safely pruning only the merged feature branches from local and remote origin.

What is the best way to prune local and remote Git branches after a merge?

The best way to prune local and remote Git branches after a merge is to automate the cleanup process. This detects branches fully merged into the main development branch and removes them from both your local environment and the remote origin simultaneously to improve repository management.

How do I remove stale remote origin branches after merging a feature into dev?

To remove stale remote origin branches after merging a feature into dev, you can automate the deletion of Git branches that have been fully merged upstream. This cleans up the corresponding remote branches to prevent clutter and improve overall repository management.