Collaborate on a stack
Learn how to work on shared collaborative stacks with other Graphite users.

Stacking doesn't have to be single-player, and it's a great way to collaborate with teammates on a project or feature! This page talks about how to fetch remote stacks, stack on-top of your co-worker's PRs, and submit your own changes when working with others.

gt get allows you to pull your coworker's stacks from remote into your local repository to see their changes on your own machine or as a starting point for collaboration.

For example, coworker A creates and submits their branch:

Terminal
gt create my_branch -m "My changes"
gt submit

Then, coworker B pulls the branch to their machine:

Terminal
gt get my_branch

This syncs all branches that my_branch depends 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.


Tip

gt get is also the recommended workflow for developers who work on more than one machine: submit draft PRs for your stack on one machine with gt submit and then use gt get from the other device.


To build on top of your coworker's changes, just run gt get on the branch you want to build on top of, make your changes, and run gt create , exactly the same way you would to create a stack on-top of your own branch. For example, to stack some analytics changes on-top of your coworker's frontend changes:

Terminal
gt get "my-coworkers-frontend-changes"
touch analytics.js
gt create -m "add-analytics"

Lastly, when you're ready to, just run gt submit to submit your new branches to Graphite.

As you and your teammates push to your shared stack, you should both periodically run gt sync to pull down any changes the other has made.

If you encounter any conflicts during restacking, Graphite will drop you into the same conflict resolution flow that you are already familiar with from both Graphite and git.

We strongly recommend that coworkers who wish to collaborate on a branch both use gt to ensure that the dependencies are managed and synced correctly as you work together.

Only branches that your coworkers have submitted with gt can be synced down to your local environment, 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 git pull and gt branch track.

Stay unblocked. Ship faster.
Experience the new developer workflow - create, review, and merge code continuously. Get started with one command.
Get started