is there a way to just submit the current branch I...
# how-do-i
l
is there a way to just submit the current branch I'm on? it seems it always defaults to pushing the entire stack. This ends up overwriting my coworkers changes if I'm stacked on their PR
d
does
gt submit --branch
work?
i actually can't tell from the
--help
output.
➕ 1
l
--branch
just says that it will run this command from this branch, but the
submit
command description says that it will force push all branches.
d
yeah, i think it needs to submit downstack branches as well 🤔
so you're stacked on top of a coworker's branches, and they are working on those branches actively as well basically?
(i'm asking in our internal CLI channel, as i've never personally done collaboration with another person in the same stack. i want to find out if this is a product gap, or you just don't have the right guides/docs)
curious if this works from your branch
Copy code
# First get the branches downstack from you that your coworker is working on
gt get

# you should be restacked on top of those now

# finally, submit your branch on top
gt submit
my thought is:
gt get
will make sure all your branches are up to date first
j
it is an invariant that you need to be based on the current version of the parent branch at submit time, so we require all downstack branches to be up to date. we are looking into adding a "pinned" state for branches you dont intend to contribute to, which might make this case better, but for now, using
get
is the preferred flow
l
okay makes sense. thanks for confirming this is the case. I have overwritten their changes in the past because I didn't realize this is the behavior since I assumed it would only modify branches that I owned unless I specify otherwise. (fwiw I come from mercurial so a lot of the assumptions are based on my old workflows there)
👍 1