This message was deleted.
# how-do-i
s
This message was deleted.
j
We have a CLI command for this (
gt fold
)! The one caveat I'll mention up front, because it is a gotcha that has confused folks in the past — if you fold a branch into its parent, you need to manually close the PR if you already had one open. We do plan to look at making this flow more integrated with remote in the future, and potentially adding functionality to squash branches via the web app.
👍 1
d
if you fold a branch into its parent, you need to manually close the PR if you already had one open
interesting - i did
gt fold
today and the PR got marked Merged i was folding the top most PR into the 2nd top most PR, in case that makes a difference
j
In certain cases GitHub will do that when it can detect it, but it's not guaranteed (e.g. if you also restacked or changed the parent branch) and requires a resubmit.
s
I see, I was mostly curious due to the message you get on the dependent PRs:
This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite
I'll note that I basically never rebase, so my mental model is a bit stuck on how I'd do stacking manually (with merges — PR 2 based on PR 1 gets merged into PR 1 before PR 1 gets merged into main). Whereas with proper rebase-based stacking the order is opposite (bottom to top). Will do a bit more docs reading, but so far really impressed with how Graphite works and can't wait to try it on some real projects where we tend to have huge PRs.
❤️ 1
j
Yeah — that message is based on the assumption that you will merge PRs into the trunk branch. Perhaps there's some slight copy adjustment we can do to make that clearer. The mental model I have for this is that anything you do with your PRs outside of merging to trunk is free-for-all, and we think of mergeability as getting code into trunk.
👍 1
Let us know if you have any other questions as you're getting started!
👍 1
s
I see, that makes a lot of sense. Tested it now and if I merge an upstack PR into a downstack one, Graphite has no issues with it and even the UI is very helpful. Agree that a slight copy change could help, since the PR is open as merging (in my case) sixth_file into fifth_file, and in that form, the PR is mergeable. If I tried to hard merge it into main then yeah I can see why the warning tells me not to do that. Thanks a lot for the explanation!