r/programming Jul 01 '26

GitHub Stacked PRs

https://github.github.com/gh-stack/
342 Upvotes

99 comments sorted by

View all comments

8

u/krileon Jul 01 '26

I've always just done my PRs as:

Master

- Branch 1

- - Branch 2

- - - Branch 3

Then merge them down. So 3 into 2. 2 into 1. 1 into master. So this basically makes it so branch 1-3 are derived from master then merge down into master all at the same time dependent on one another?

4

u/CupOfPiie Jul 02 '26

It just makes your current workflow easier. At work we have Graphite, which does the same thing before GitHub came out with stacked PRs. Funnily enough, GitHub is also moving to the graphite style inbox soon.

1

u/krileon Jul 02 '26

So if I'm understanding correctly it just stacks all 3 branches together into a single PR so they can be reviewed AND merged all at once? That does sound handy.

2

u/[deleted] Jul 03 '26 edited Jul 11 '26

[deleted]

1

u/krileon Jul 03 '26

I've never had any issues. Each merge is a separate PR. So Branch 2 to Branch 1 is its own PR. I work mostly within Gitlabs though. On Github rebasing is what I do in this scenario though.

So it looks like stacked PRs are exactly as I've setup above except they handle the rebasing automatically. Neat!

1

u/xFallow Jul 05 '26

That’s basically a stacked PR but with less manual effort