merge-main-cleanup

Merge the current Git branch into main and prune all other branches.

4|3|Updated Jan 23, 2026
One-click install
npx skills add https://github.com/cacr92/WeReply --skill merge-main-cleanup
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: merge-main-cleanup
Source: https://github.com/cacr92/WeReply/tree/main/.cursor/skills/merge-main-cleanup
Command: npx skills add https://github.com/cacr92/WeReply --skill merge-main-cleanup

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This skill automates the process of merging a feature branch into the main branch and subsequently cleaning up all other local and remote branches, ensuring only the main branch remains.

Core Features & Use Cases

  • Consolidated Merging: Merges the current branch into the designated base branch (main or master).
  • Branch Pruning: Deletes all local and remote branches except for the base branch after a successful merge.
  • Worktree Cleanup: Removes any associated worktrees tied to the deleted branches.
  • Use Case: After completing a feature and merging it into main, use this skill to automatically remove all feature branches and their associated worktrees, leaving a clean repository.

Quick Start

Run the merge-main-cleanup skill to merge the current branch into main and delete all other branches.

Frequently Asked Questions about merge-main-cleanup

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

FAQPage Schema
How do I merge a git branch into main and delete all other branches automatically?

To merge a git branch into main and delete all other branches, you can automate the process by merging the current branch into the base branch and then pruning all local and remote feature branches along with their associated worktrees.

What is the best way to clean up local and remote git branches after a merge?

The best way to clean up local and remote git branches after a merge is to prune them automatically once the merge into the main branch is successful, ensuring only the base branch remains in the repository.

How does git branch pruning handle associated worktrees during repository cleanup?

During repository cleanup, git branch pruning removes any associated worktrees tied to the deleted branches, ensuring that all local and remote feature branches are completely eradicated from your environment.

Does the branch merge and cleanup process validate the repository state beforehand?

Yes, the branch merge and cleanup process validates the repository state by checking for uncommitted changes and fetching all remote branches before initiating the merge and deletion process.

Can I delete both local and remote git branches simultaneously after merging into main?

Yes, you can delete both local and remote git branches simultaneously by fetching all remote branches first, merging into the base branch, and then pruning every branch except main or master.

What happens to uncommitted changes when automating a git merge and branch cleanup?

When automating a git merge and branch cleanup, the process validates the repository state by detecting uncommitted changes before initiating the merge, preventing data loss and ensuring a clean working directory.