Streamlining Stacked PRs: Why Developers Seek 'Merge' Over 'Rebase' for Better Application Development Project Plans

GitHub's introduction of Stacked Pull Requests aimed to streamline complex feature development, allowing developers to break down large changes into smaller, dependent PRs. While the concept promises enhanced organization and faster reviews, a recent community discussion on GitHub highlights a significant friction point: the reliance on rebasing.

A developer considers two Git workflow options: linear rebase vs. merge commits for stacked pull requests.
A developer considers two Git workflow options: linear rebase vs. merge commits for stacked pull requests.

The Rebase Dilemma in Shared Stacks

In a discussion initiated by user sdevilliers, the core concern revolves around the default rebasing mechanism for updating stacked PRs. The original poster articulated a common developer sentiment: "Rebasing is something I only do on my branch before sharing it with others because it changes the history." This practice is a cornerstone of many team's application development project plan, ensuring a clean, linear history for individual work before it's exposed to collaborators.

The issue intensifies when stacked PRs are shared. Updating a stack via rebase often necessitates a --force-push, a command widely considered risky on shared branches due to its potential to overwrite collaborators' work and complicate history. For teams striving for robust software project statistics on code stability and review cycles, frequent force-pushes can introduce unpredictable elements.

Impact on Code Reviews and Developer Productivity

The sentiment was echoed by abhishekm-current, who pointed out a critical side effect: "rebasing the branches and force-pushing makes 'Change since your last review' diff option in Github practically useless." This particular GitHub feature is invaluable for reviewers, enabling them to focus solely on new modifications since their last pass, significantly boosting developer productivity. When a rebase occurs, the entire branch history changes, making it impossible for GitHub to accurately track incremental changes for review purposes. This forces reviewers to re-evaluate the entire PR, negating the efficiency gains that stacked PRs are supposed to offer.

This challenge directly impacts the efficiency of an application development project plan. If review cycles become longer and more cumbersome due to rebase-induced diff issues, the overall project timeline can suffer, and the benefits of modularizing work into stacks are diminished.

Developers efficiently reviewing code changes, benefiting from clear diffs in a collaborative environment.
Developers efficiently reviewing code changes, benefiting from clear diffs in a collaborative environment.

The Proposed Alternative: 'Merge Latest Into Stack'

The community's proposed solution is a "Merge Latest Into Stack" button. This alternative would allow developers to integrate changes from the base branch (e.g., main or master) into their stacked PRs using a merge commit, rather than rewriting history with a rebase. As sdevilliers explained, they currently achieve this manually: "Currently I stack PRs manually and 'merge' master through the stack when a conflict arises."

A dedicated button for this functionality would provide the flexibility that many teams need, aligning with existing Git workflows that prioritize preserving history on shared branches. This would empower teams to adopt stacked PRs without compromising their established code review practices or introducing the risks associated with frequent force-pushes.

Why Flexibility Matters for Modern Development

The discussion underscores a broader theme in developer tooling: the need for flexibility to accommodate diverse team workflows. While rebasing offers a clean, linear history, merging preserves the chronological order of events and the distinct integration points. For shared branches, especially in an active application development project plan, merging is often preferred to maintain an auditable history and avoid disrupting ongoing reviews.

Providing both rebase and merge options for stacked PRs would allow teams to choose the strategy that best fits their specific software project statistics goals and internal guidelines, ultimately enhancing developer productivity and the overall experience of using GitHub for complex projects.

|

Dashboards, alerts, and review-ready summaries built on your GitHub activity.

 Install GitHub App to Start
Dashboard with engineering activity trends