|
I'm playing around with GitHub stacks, which is now in public preview. I see how to add a new PR on top of an existing stack, but is there a way to add a new PR to the bottom of the stack? The use case for this is that the bottom PR is too large, so I create a new branch halfway through the commits of the bottom PR, open a PR for it, and then re-target the original bottom PR to target the new PR branch. But I don't see a way to change the base of a stacked PR; the UI locks it. I ended up deleting the stack, which allowed me to change the base and then create a new stack. |
Replies: 1 comment
|
There are two slightly different cases here. If you only need a new empty layer below the current bottom branch, recent versions have gh stack submitFor the actual case you described—splitting the commits of an existing bottom PR—the documented limitation is that gh stack unstack
gh stack init new-bottom old-bottom
gh stack submit
|
There are two slightly different cases here.
If you only need a new empty layer below the current bottom branch, recent versions have
gh stack modify. Put the cursor on the bottom branch, pressito insert below it, then save withCtrl+Sand run:For the actual case you described—splitting the commits of an existing bottom PR—the documented limitation is that
modifycannot split a branch. You still need to create the split branches in Git first, then rebuild the stack from those existing branches:initcan adopt existing branches. So your delete/recreate workaround was basically the right approach for a r…