Learn to use the Graphite CLI to create a single pull request.
gt
CLI. Your goal is to learn how your existing Git/GitHub workflow for creating pull requests maps to gt
commands.
This tutorial intentionally avoids discussing stacked pull requests, so you can stay focused on building confidence with the basic single PR workflow.
gt
in this repo, run gt init
and select your trunk branch when prompted (usually main
or master
):
gt
and you’re ready to start making your first pull request.
git status
and confirm that activity_feed.js
shows up as an untracked file. At this point, you’re ready to commit your work to a new branch.
gt create
command, which:
activity_feed.js
.
To commit this new file & create a new branch for it:
gt log short
, you should see your new branch, with an indicator that you’ve also checked the branch out:
gt create
takes an --all
flag that will stage your unstaged changes for you, similar to git commit --all
.Both --all
and --message
have short versions: gt create -am "commit message"
works the same as git commit --all --message "commit message"
.gt create
already checked out your new feature branch for you, run the following command to create a new pull request:
$EDITOR
for editing.gt submit
completes, it will print out the URL of the newly created pull request. You can either directly click the URL, or run gt pr
to quickly open the new PR in your default browser.
gt pr
will take you to by default. However, your coworkers can still decide whether to review with Graphite or GitHub, as we 2-way sync every pull request.Comments & feedback from the GitHub PR interface will show up on Graphite, and vice versa!gt
, you can make this a little easier.
If you need to check out your branch, you can do it with autocomplete and/or arrow key selection by running:
git add && git commit
, you can run:
--commit
flag to gt modify
: