Learn how to visualize stacked branches with the Graphite CLI.
gt
in a repository of your choice
gt log
log
commands to view a stack of branches:
gt log short
short
subcommand allows you to quickly navigate and switch between branches in a stack.
gt log long
log long
shows the current git
history instead of the Graphite view:
log
and log short
both support a series of optional flags. Since log long
is just a shortcut for the aforementioned git
command, it doesn’t have the same customizability.
gt log --stack
: shows the direct descendants and ancestors of the current PR. By default the commands show all branches currently tracked with Graphite.
gt log --steps <n>
: implies --stack
but only shows n levels of descendants and ancestors.
gt log --reverse
: displays the log with trunk
(also known as main
) at the top instead of the bottom. Useful for larger stacks to keep their tips near the bottom of the output.
gt log
also includes a link to the PR page and some details about its status.
You can view information for one branch at a time with gt branch info
. By default this shows the children and parents of the branch, as well as the descriptions for each commit in the branch. There are also --description
and --patch
options to see the PR description (if one exists) and the changesets of each commit.