Live streamJoin us for "State of code review 2024" on July 18thRegister today

List all Git branches

Greg Foster
Greg Foster
Graphite software engineer


This guide explains this concept in vanilla Git. For Graphite documentation, see our CLI docs.

When working with Git, especially in a repository with an active development cycle, it can quickly become challenging to keep track of all the different branches and their statuses. Understanding what branches exist, which have pending pull requests, and the general state of your local stacks is crucial for effective project management. This is where Graphite’s gt log and gt ls commands come into play, offering enhanced visibility and a beautiful presentation of your repository's branches and stacks, complete with their PR statuses.

The gt log command in Graphite goes beyond the standard git log by providing a visual tree of commits, branches, and the relationships between them. It’s particularly useful for understanding the branching structure at a glance.

Run the following command to see a tree of commits:

gt log

Callout: With gt log, you're not just seeing a list of commits; you're getting a high-level view of your project's evolution.

Graphite's gt ls command provides a succinct overview of all your branches and stacks, including the PR status for each. This allows you to quickly understand which branches are associated with open PRs, which have been merged, and which are still in progress.

To see a list of your stacks and their PR statuses, simply execute:

gt ls

This command will display all local branches, the stacks they belong to, and whether they're linked to any open PRs.

Callout: gt ls is your command center for local branch management, offering a snapshot of each branch's current trajectory within your project.

When you use gt ls, Graphite not only lists the branches but also enriches this list with the PR status. This integrated perspective helps you determine if a branch has been merged, has an open PR, or is yet to be proposed for merging.

Branch management in Git can be complex, but with Graphite’s gt log and gt ls commands, it becomes more manageable and visually intuitive. These commands provide a beautiful and practical way to list all branches and stacks locally, including their PR statuses, which empowers developers to maintain a high level of awareness over their repository's state.

For a comprehensive guide to using these commands and taking full advantage of Graphite’s powerful features, visit the Graphite documentation. Dive deeper into the capabilities of Graphite and enhance your Git workflow today.

Stay unblocked. Ship faster.
Experience the new developer workflow - create, review, and merge code continuously. Get started with one command.
Get started

Give your PR workflow
an upgrade today

Stack easier | Ship smaller | Review quicker

Or install our CLI.
Product Screenshot 1
Product Screenshot 2