merge-stack

Merge dependent GitHub Pull Requests sequentially into the main branch.

1|Updated Feb 6, 2026
One-click install
npx skills add https://github.com/rarestg/rarestg-skills --skill merge-stack
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: merge-stack
Source: https://github.com/rarestg/rarestg-skills/tree/main/skills/merge-stack
Command: npx skills add https://github.com/rarestg/rarestg-skills --skill merge-stack

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill automates the process of merging a series of dependent GitHub Pull Requests (PRs) that form a linear chain, ensuring they are integrated into the main branch one by one without manual intervention.

Core Features & Use Cases

  • Sequential Merging: Merges PRs in a specific order, starting from the one targeting the main branch.
  • Automated Re-targeting: Automatically updates the base branch of subsequent PRs to main after a preceding PR is merged.
  • Conflict Handling: Stops and reports if a merge conflict occurs, preventing further unintended actions.
  • Use Case: When you have a feature broken down into multiple small PRs (e.g., feature-1, feature-2, feature-3), where each depends on the previous one, this skill merges them cleanly into main.

Quick Start

Use the merge-stack skill to merge the PR stack starting with branch prefix 'feature-'.

Frequently Asked Questions about merge-stack

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

FAQPage Schema
How do I merge a stack of dependent GitHub PRs sequentially?

Merging stacked GitHub PRs sequentially requires starting with the PR targeting the main branch. After each merge, subsequent dependent PRs are automatically re-targeted to main, preserving commit history and integrating the chain cleanly.

What is a linear stack of GitHub Pull Requests?

A linear stack of GitHub Pull Requests is a chain of dependent branches where each PR targets the previous one, and the bottom-most targets main. This setup allows large features to be broken into small, dependent PRs for sequential integration.

Does merging stacked PRs require the gh CLI?

Yes, merging stacked PRs requires the gh CLI for Git operations. The sequential merge process relies on it to handle re-targeting branches and integrating the stack into the main branch automatically.

How does automated re-targeting work for stacked PRs?

Automated re-targeting for stacked PRs works by updating the base branch of subsequent PRs to main after a preceding PR is merged. This ensures the chain remains intact and sequential merging preserves the commit history.

What happens when a merge conflict occurs in a PR stack?

When a merge conflict occurs in a PR stack, the sequential merging process stops and reports the conflict. This prevents further unintended actions and ensures the remaining dependent PRs are not merged incorrectly.