Learn the key differences between working with the Graphite CLI vs. vanilla git.
gt
and git
, like fixup commits, working asynchronously, check pointing, syncing from remote, and restacking.
Once you learn more about gt
and how it interacts with git
, you can then re-integrate your previous git
workflow into gt
.
title
so you can search through this field quickly
searchTasks(string searchQuery) -> Task[]
git
:
gt
:
gt create
command above). You can get each PR reviewed by a person who is familiar with that particular change.
This solves the two issues when using git
: each PR with gt
is small (and easier to review), and you can get reviews from different people for different parts of your change depending on their expertise.
git
:
gt
:
gt submit --stack
versus just gt submit
because changes up the stack will not receive the new updates otherwise. This will result in the PR diff on the UI to not match what you see locally through git show
or gt info --diff
for any upstack PRs.gt
is so powerful is because it enables working asynchronously. Because each branch in the stack is independent, you can keep building on top of the existing changes without worrying about growing the size of your PR and making things a worse experience for reviewers.
Let’s say you’re waiting on your above PR(s) to be reviewed, when a colleague has a great idea that rather than just allowing people to search for tasks, you should also allow them to search for user profiles in the same UI.
In git
, you now have three options:
task_search
is merged into main
, pull main
, then create a new branch profile_search
and repeat the earlier steps
profile_search
task_search
with all changes required to implement profile_search
task_search
PR which was already large, and wait for reviews from new reviewers, and so on.profile_search
on top of task_search
, and make changes to that.
task_search
, and run a rebase. The gt
workflow handles this for you automatically.gt
, you can simply run:
git commit
is to check point yourself in the process of development. An example commit history would look something like:
gt
, just use gt create
every time you would git commit
. However, it is important to not gt submit
the entire stack until some organization is done, otherwise each of your intermediate check points will create PRs, making for a really poor review experience for your reviewers. Instead, once you have your changes in a good place, use gt fold
to fold a child branch into its parent. This will allow you to create checkpoints without submitting PRs for each checkpoint.
gt fold
? You can always split it back into separate branches with gt split
.main
, or someone makes changes that you want to use. In git
, to handle this you could do:
gt
, you would do the following instead:
gt restack
tells Graphite to check if any rebases need to happen in order to correct your dependency list. For example, let’s say you make a change lower down in the stack, in PR #1. PR #3 doesn’t know about this until you dogt restack
. Sogt restack
is telling Graphite that you have made changes on a PR that could affect its children—to check the children for any conflicts, and perform a rebase if it finds them.