Configure the CLI
Learn how to configure the Graphite CLI to customize and speed up your workflow.

Graphite supports zsh, bash, and fish tab completion. You can run one of the following commands:

Terminal
gt completion >> ~/.zshrc
Terminal
gt completion >> ~/.bashrc

or

Terminal
gt completion >> ~/.bash_profile
Terminal
gt fish >> ~/.config/fish/completions/gt.fish

Run gt config to open an interactive menu which lets you configure your Graphite CLI. The options are described in more detail below.


Note

User configuration is stored in ~/.config/graphite, unless you have $XDG_CONFIG_HOME set.


If you don't specify a name for your branch when using gt create, then Graphite will generate one for you based on the commit message.

There are several options to configure:

  1. A custom prefix (for example, initials).

  2. Whether or not the date is prepended to the branch.

  3. Whether to allow certain characters like slashes and uppercase letters

  4. The character to replace unsupported symbols (for example, whitespace and anything other than alphanumeric characters, periods, dashes, underscores, and slashes.)

Set PR metadata in CLI

Graphite lets you prepare your PR for review in the web UI by default. This allows you to preview markdown, pull options like reviewers and labels from downstack PR's, and update all PR's in a stack at once.

Enable this setting to instead default to writing PR description in the CLI.

PR description

Graphite includes your GitHub PR template in the commit message by default.

Graphite can include the commit messages of your branch in the body of your PR automatically on submit. If you enable this, you can choose whether or not to also include your PR template.

If you only have a single commit on your branch, the first line of the message (its title) will not be included as this is already the default for the name of the PR.

By default, Graphite uses the git editor for drafting PR descriptions and other flows that require editing text. You can configure a different editor.

By default, Graphite opens PR descriptions and other flows that require editing text in the git pager. You can configure a different pager, or disable paging entirely.

Note that just like git, Graphite sets the environment variables LESS=FRX and LV=-c if they are not already set. If something else is setting your LESS env var, you can use gt user pager --set "less -FRX" to get the recommended pager settings.


Tip

You can also set the editor or pager on a per-command basis with the GT_EDITOR and GT_PAGER environment variables, respectively.


The git rebase flag --committer-date-is-author-date is useful if you don't want your Graphite restack operations to update the committer date of the commits in your branches. In order to have Graphite's internal rebases use this flag, you can enable this configuration.

Toggle on and off inline tips in the Graphite CLI.

If you use a Yubikey to protect your GitHub SSH key, you may be used to Git commands reminding you to touch it. Graphite is not able to print this output directly to the CLI due to how Git calls SSH, so you can enable this configuration to be reminded when Graphite is about to run a command that requires you to touch your Yubikey.


Note

Repository-level configuration is stored in the .git folder of your repository.


Graphite defaults to pushing to and pulling from origin. If you have configured a different name for your remote, you can set it manually.

Once the remote URL is set, Graphite infers the GitHub repository name and owner from the remote URL, but in cases where they are not inferred correctly, you can override them.

Graphite
Git stacked on GitHub

Stacked pull requests are easier to read, easier to write, and easier to manage.
Teams that stack ship better software, faster.

Or install our CLI.
Product Screenshot 1
Product Screenshot 2