Common CLI commands

While you can find a full list of gt commands in the command reference, there are a handful of common commands and combinations to remember.

This list is grouped by primary function.

Basic workflow commands

These commands are constantly in use when creating and pushing changes to a repository with Graphite.

gt log shortgt lsRun any time branches are created/manipulated/changed
gt branch create --all --message <COMMIT_MESSAGE>gt bc -am <COMMIT_MESSAGE>Create changes, stage the changes, create a new branch and commit the changes to the new branch all at once
gt commit create --message <COMMIT_MESSAGE>gt cc -m <COMMIT_MESSAGE>Update an existing branch with new changes by creating an entirely new commit on that branch
gt commit amendgt caUpdate an existing branch with new changes by amending the existing commit on that branch
gt repo sync --restackgt rs -rPull changes from your trunk branch and subsequently restack upstack changes
gt stack submitgt ssSubmit your changes across all PRs on a stack

Collaborate on a stack

Commands to view teammates' code and communicate changes.

gt downstack get <BRANCH_NAME>gt dsg <BRANCH_NAME>Get a stack locally that's been created or manipulated by someone else. Often followed up with `gt bdl` to delete irrelevant branches locally.
gt branch checkoutgt bcoOften used when to check out a singular branch for collaboration OR personal use

Stack navigation/manipulation commands

Commands to move up and down the stack, and to restack branches (if necessary).

gt branch up, gt branch downgt bu, gt bdQuickly move up and down a stack of branches. By default, it takes a step argument of 1, but can add a step value (for example, `gt branch up 2`) to skip a certain number of branches.
gt branch bottom, gt branch topgt bb, gt btQuickly move all the way down (`bb`) or all the way up (bt) a stack