We are attempting to use multiple trunks but when ...
# how-do-i
m
We are attempting to use multiple trunks but when other people try to run
gt get
on a branch that has a none default trunk they receive this error:
ERROR: Cannot perform this operation on untracked branch <name of second trunk branch>
. This makes it seem like it's not seeing the base branch as a trunk correctly. Is there anything special to do workflow wise when multiple people are working on a non default trunk?
a
You might need to add a 2nd trunk branch? In the
gt config
UI, you can change the default trunk and add additional trunks. We have 3 trunks configured in our repos,
preview
(default branch in GitHub, where most PRs go),
main
and
hotfix
and we haven't had that issue afaik?
j
Hey all - Ally is right here. For multiple trunk workflows, each developer needs to configure the non-default trunk in their local Graphite CLI setup before working with branches based on it. The documented setup is to add the branch as an additional trunk:
gt trunk --add <trunk-name>
You can confirm it is configured with:
gt trunk --all
Once that trunk is configured locally,
gt get
should work with branches based on it as part of the normal multi-trunk workflow. Docs: https://graphite.com/docs/multiple-trunks#develop-on-multiple-trunk-branches If the trunk already appears in
gt trunk --all
and
gt get
still reports it as untracked, please send the exact
gt get
command, the full output, and
gt --version
.
m
Thank you, the devs were running gt trunk add but we'll double check and try again.