This message was deleted.
# how-do-i
s
This message was deleted.
a
If you merge through Graphite, you can merge them all (go to top PR in stack & hit Merge). We merge them from bottom to top, which is what we recommend you do as well if you were to do so manually.
r
@Aryaman Am I able to merge only the PR from the top of the stack, without merging the PRs below? In my case, there are no files in common between all the PRs in the stack.
a
To be clear, do you want to merge the PRs on the top of the stack into their children or the
main
branch?
r
I want to merge to
main
a
If you want to just merge onto
main
, and there are no dependencies on the downstack branches, you can
gt branch checkout <branch>
and then
gt restack onto main
So let's say you have
main
->
branch1
->
branch2
->
branch3
, and branch3 does not depend on branch1 or branch2, you can just restack onto main, gt stack submit
and then merge
r
Genius! Thank you!!!
a
if there is a dependency though, you should merge bottom to top
r
after
restack
do I need to do a
stack submit
?
a
Yes
So that remote is up to date on local state
r
Awesome! Thanks to the help.
I’m having a little trouble figuring out the command to run.
do I want
gt branch restack
?
a
gt upstack onto main
Not restack onto main sorry
r
It works! Thank you.
t
it’d be very useful to me if Graphite made that kind of merge easier. It has come up a few times and the reshuffling of branches is a bit of a drag