Good afternoon, is there a way to merge stacks int...
# how-do-i
a
Good afternoon, is there a way to merge stacks into a feature branch instead of main? I have
main -> A -> B
and I want to merge
B
into
A
. The app doesn't give me the option. I could just merge the PR in GH and upstack onto the new branch of course.
a
gt branch checkout B
,
gt branch fold
then
gt stack submit
a
So there's nothing that actually goes through the GH review process. What I'm looking for is a way to push up PRs, merge them same as I normally would, but do it do a feature branch. That way at the end I can just submit the whole thing.
a
Hmmm maybe I am misunderstanding, but doesn't this address your usecase? 1. setup two branches,
main
->
A
->
B
2. get
A
&
B
reviewed separately 3. fold
A
&
B
4. merge
AB
into
main
a
It does, the only difference is that at the end the PR must be closed instead of merged. We squash and merge and link the commits in main to our PRs and we would lose that process or have to fake it.
a
Could you share the full process you are hoping to achieve? I'm not sure I understand the issue fully
a
Sure, so we have a feature branch,
FEATURE
based off main. The team is working on those branches, say 2 people. We create a stack where we work off each others,
main -> FEATURE -> A -> B
.
A
and
B
both are ready for reviewed.
A
is approved on Github and we want to merge it into
FEATURE
. At the moment this is not allowed on the graphite interface. Post merge, we want
main -> FEATURE -> B
. Then when I run
gt repo sync
I'd like branch
A
to be deleted. What you're suggesting is instead of merging on Github, we should fold locally and push. This would close the PR and it wouldn't be considered "merged".
What I did yesterday was to merge the PR, then locally I pulled
FEATURE
then upstacked
B
onto
FEATURE
so that I get
main -> FEATURE -> B
, then I had to rebase onto FEATURE and drop the commits that were in A since we use squash-merge.
a
Ah I see. Graphite generally makes the assumption of trunk based development, so I'm not fully sure how best to support your workflow. I'll let @Jacob Gold chime in, who might have some ideas.