When a dev creates a branch on their machine, and ...
# how-do-i
m
When a dev creates a branch on their machine, and I run gt sync, it doesn't automatically create the stack on my machine? What if I want to collab with them on the stack or make changes directly? Do I have to manually track the branches myself?
p
(If applicable) To help us more clearly understand what you're trying to do, please provide additional details about: - Screenshots / debug logs / list of commands you've tried to run so far - Your workflow - Current state
hey Mathew, yes that's correct. Check out our docs for collaborating on a stack
hey Mathew, yes that's correct. Check out our docs for collaborating on a stack
m
Hey I'm super confused. When my colleague pushes a new branch / commit ONTO a stack that I already have on my computer, there HAS to be a way to automatically pull that branch into the stack on my computer
Right now I have to check my git log, copy the name of the remote branch, and run gt get BRANCH -- no way that's the right way to do it
p
As you and your teammates push to your shared stack, you should both periodically run: •
gt sync
to pull down any new changes the other has made to existing branches •
gt get
for each net new branch the other has made •
gt submit
to push up changes
m
My point is gt get DOES NOT pull in new branches unless I manually specify the name of the branch
if I'm checked out to ANY branch in a stack, and run gt get -- shouldn't any NEW branches that have been pushed to that stack automatically sync to my machine? What if my coworker pushed 5 new branches? I have to run gt get BRANCH #1, gt get BRANCH #2 manually?
p
If the new remote branches are upstack from your top branch locally then gt get won't be able to sync them currently. But I'd expect if you run
gt get
on the top branch of the new remote branches that it would pull all the other new branches underneath it as well
m
How does that make sense? If my dev adds branches on top of a stack we're working on together, there has to be a way to automatically sync our stacks without manually specifying every branch he pushed
Why would that not be the case?
p
This is a technical limitation unfortunately at present: "Note that remote-only branches upstack of the branch are not currently synced". Getting the very top new branch should sync all those underneath it automatically though.