Collaborating on a stack
gt downstack getallows you to pull your coworker's stacks from remote into your local repository.
For example, coworker A could create and submit their branch:
gt branch create my_branch -m "My changes"
Then, coworker B could pull the branch to their machine:
gt downstack get my_branch
This will sync all branches that
my_branchdepends on (starting from the bottom of the stack). If any of the branches already exist locally and differ from the remote version, Graphite will ask to either overwrite your local changes, or rebase them on top of the remote version.
gt downstack getis also the recommended workflow for developers who work on more than one machine — submit draft PRs for your stack on one machine with
gt stack submitand use then use
downstack getfrom the other device!
We strongly recommend that coworkers who wish to collaborate on a branch both use
gtto ensure that the dependencies are managed and synced correctly as you work together.
Only branches that your coworkers have submitted with
gtcan be synced down to your local, as we rely on the Graphite submission to keep track of the dependency tree.
If you want to stack on top of your non-Graphite-using coworkers’ branches, the best way to do this is
gt branch track.
submitprefers that your branches are restacked, but only the branches that you are submitting need to be restacked. This means that if you are working on some branches stacked on top of an old version of a coworkers branch, and you'd prefer not to mess with their changes, including rebasing them, you can use
gt upstack restackon your own changes and
gt upstack submitto submit them without restacking (and therefore changing) your coworker's branch. Once your coworker lands their changes, you can
repo syncand restack your branches on the new version of