> ## Documentation Index
> Fetch the complete documentation index at: https://graphite-58cc94ce.mintlify.site/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Visualize a stack

> Learn how to visualize stacked branches with the Graphite CLI.

## Prerequisites

To visualize a stack of branches with the Graphite CLI, make sure you've:

* [Installed and configured the CLI](/install-the-cli)

* [Authenticated with GitHub](/authenticate-with-github-app)

* [Initialized `gt`](/cli-quick-start#initializing-graphite) in a repository of your choice

* [Created](/create-stack) or tracked a branch or stack of branches

## Visualize a stack of branches

Using a stacked changes workflow allows you to easily visualize the dependencies between all of your branches, pull down other teammate's branches to collaborate, and even view multiple stacks of changes at once.

Graphite provides three ways to visualize your stack, ranging from extremely detailed with lots of metadata, to very simple and to-the-point.

### `gt log`

This is one of the most commonly used `log` commands to view a stack of branches:

```bash terminal theme={null}
> gt log
◉ pp--06-14-part\_3 (current)
│ 8 seconds ago
│
│ 95338df - part 3
│
◯ pp--06-14-part\_2
│ 8 seconds ago
│
│ 95610c6 - part 2
│
◯ pp--06-14-part\_1
│ 27 seconds ago
│
│ 48cd85e - part 1
│
◯ main
│ 5 weeks ago
│
```

### `gt log short`

The `short` subcommand allows you to quickly navigate and switch between branches in a stack.

```bash terminal theme={null}
> gt log short
◉ pp--06-14-part\_3
◯ pp--06-14-part\_2
◯ pp--06-14-part\_1
◯ main
```

### `gt log long`

+The output of `log long` shows the current `git` history instead of the Graphite view:

```bash terminal theme={null}
> gt log long
* 95338df - (7 minutes ago) part 3 - Pranathi Peri (pp--06-14-part\_3)
* 95610c6 - (7 minutes ago) part 2 - Pranathi Peri (pp--06-14-part\_2)
* 48cd85e - (8 minutes ago) part 1 - Pranathi Peri (pp--06-14-part\_1)
* 68722ac - [Product] Add TicTacToe react game frontend (#133) - Nicholas Yan (origin/main, origin/HEAD, main)
* c651c74 - [Product] Add server for TicTacToe react game (#132) - Nicholas Yan
* eec07e3 - [Product] Add API for TicTacToe react game (#131) - Nicholas Yan
```

### Optional flags

`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.

### More about your branches

Once you've [submitted your branches with Graphite](/create-a-pull-request), `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.
