Configure the CLI
Graphite offers a number of configurations to customize and speed up your current workflow when using the CLI.
fish tab completion. You can run one of the following commands:
# for zshgt completion >> ~/.zshrc
# for bashgt completion >> ~/.bashrc# orgt completion >> ~/.bash_profile
# for fishgt fish >> ~/.config/fish/completions/gt.fish
gt config to open an interactive menu which lets you configure your Graphite CLI. The options are described in more detail below.
User configuration is stored in
~/.config/graphite, unless you have
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 three options to configure:
Whether or not the date is prepended to the branch.
A custom prefix (for example, initials).
The character to replace unsupported symbols (for example, whitespace and anything other than alphanumeric characters, periods, dashes, underscores, and slashes.
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
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.
You can also set the editor or pager on a per-command basis with the
GT_PAGER environment variables, respectively.
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.
Repo-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.