This reference documents every command and flag available in Graphite’s command-line interface.
--help
Show help for a command.
--allCommands
This is not printed with the global help, but if passed to gt —help —all, will print out the full list of command help.
--cwd
Working directory in which to perform operations.
--debug
Write debug output to the terminal.
--interactive
Enable interactive features like prompts, pagers, and editors. Enabled by default. Disable with --no-interactive
.
--verify
Enable git hooks. Enabled by default. Disable with --no-verify
.
--quiet
Minimize output to the terminal. Implies --no-interactive
.
gt abort
-f, --force
Do not prompt for confirmation; abort immediately.
gt absorb
-a, --all
Stage all unstaged changes before absorbing. Unlike create and modify, this will not include untracked files, as file creations would never be absorbed.
-d, --dry-run
Print which commits the hunks would be absorbed into, but do not actually absorb them.
-f, --force
Do not prompt for confirmation; apply the hunks to the commits immediately.
-p, --patch
Pick hunks to stage before absorbing.
gt add [args..]
[args] (optional)
git add arguments
gt aliases
--legacy
Append legacy aliases to your configuration. See https://graphite.dev/docs/legacy-alias-preset for more details.
--reset
Reset your alias configuration.
gt auth
-t, --token
Auth token. Get it from: https://app.graphite.dev/activate
gt bottom
gt changelog
gt checkout [branch]
[branch] (optional)
The branch to checkout.
-a, --all
Show branches across all configured trunks in interactive selection.
-u, --show-untracked
Include untracked branches in interactive selection.
-s, --stack
Only show ancestors and descendants of the current branch in interactive selection.
-t, --trunk
Checkout the current trunk.
gt cherry-pick [args..]
[args] (optional)
git cherry-pick arguments
gt children
gt completion
bash
or zsh
tab completion.
gt config
gt continue
-a, --all
Stage all changes before continuing.
gt create [name]
[name] (optional)
The name of the new branch.
--ai
Automatically AI-generate the branch name and the commit message (if unset)
-a, --all
Stage all unstaged changes before creating the branch, including to untracked files.
-i, --insert
Insert this branch between the current branch and its child. If there are multiple children, prompts you to select which should be moved onto the new branch.
-m, --message
Specify a commit message.
--no-ai
Do not automatically AI-generate the branch name and the commit message. Takes precedence over —ai.
-p, --patch
Pick hunks to stage before committing.
-u, --update
Stage all updates to tracked files before creating the branch.
-v, --verbose
Show unified diff between the HEAD commit and what would be committed at the bottom of the commit message template. If specified twice, show in addition the unified diff between what would be committed and the worktree files, i.e. the unstaged changes to tracked files.
gt dash
gt delete [name]
[name] (optional)
The name of the branch to delete. If no branch is provided, opens an interactive selector.
-f, --force
Delete the branch even if it is not merged or closed.
gt demo [demoName]
[demoName] (optional)
Demo to run
gt docs
gt down [steps]
-n, --steps
The number of levels to traverse downstack.
gt feedback [message]
[message] (optional)
Positive or constructive feedback for the Graphite team! Jokes are chill too.
-d, --with-debug-context
Include logs from the past 24 hours in your feedback. This can help us understand what’s going on in your repo.
gt fish
fish
tab completion.
gt fold
-k, --keep
Keeps the name of the current branch instead of using the name of its parent.
gt get [branch]
[branch] (optional)
Branch or PR number to get from remote.
-d, --downstack
When syncing a branch that already exists locally, don’t sync upstack branches.
-f, --force
Overwrite all fetched branches with remote source of truth
--restack
Restack any branches in the stack that can be restacked without conflicts (true by default; skip with —no-restack).
gt guide [title]
gt info [branch]
[branch] (optional)
The branch to show info for. Defaults to the current branch.
-b, --body
Show the PR body, if it exists.
-d, --diff
Show the diff between this branch and its parent. Takes precedence over patch.
-p, --patch
Show the changes made by each commit.
-s, --stat
Show a diffstat instead of a full diff. Modifies either —patch or —diff. If neither is passed, implies —diff.
gt init
--reset
Untrack all branches.
--trunk
The name of your trunk branch. If no name is passed, you will be prompted to select one interactively.
gt log [command]
gt log
, gt log short
, and gt log long
.
gt log long
ignores all options and displays a graph of the commit ancestry of all branches.gt log
and gt log short
display all tracked branches and their dependency relationships.gt log
displays more information about each branch.
gt ls
and gt ll
are default aliases for gt log short
and gt log long
respectively.
[command] (optional)
The format to use. If not provided, gt log
is assumed.
-a, --all
Show branches across all configured trunks.
--classic
Use the old short logging style, which runs out of screen real estate more quickly. Other options will not work in classic mode.
-r, --reverse
Print the log upside down. Handy when you have a lot of branches!
-u, --show-untracked
Include untracked branched in the log.
-s, --stack
Only show ancestors and descendants of the current branch.
-n, --steps
Only show this many levels upstack and downstack. Implies —stack.
gt merge
-c, --confirm
Asks for confirmation before merging branches. Prompts for confirmation if the local branches differ from remote, regardless of the value of this flag.
--dry-run
Reports the PRs that would be merged and terminates. No branches are merged.
gt modify
-a, --all
Stage all changes before committing.
-c, --commit
Create a new commit instead of amending the current commit. If this branch has no commits, this command always creates a new commit.
-e, --edit
If passed, open an editor to edit the commit message. When creating a new commit, this flag is ignored.
--interactive-rebase
Ignore all other flags and start a git interactive rebase on the commits in this branch.
-m, --message
The message for the new or amended commit. If passed, no editor is opened.
-p, --patch
Pick hunks to stage before committing.
-u, --update
Stage all updates to tracked files before committing.
-v, --verbose
Show unified diff between the HEAD commit and what would be committed at the bottom of the commit message template. If specified twice, show in addition the unified diff between what would be committed and the worktree files, i.e. the unstaged changes to tracked files.
gt move
-a, --all
Show branches across all configured trunks in interactive selection.
-o, --onto
Branch to move the current branch onto.
--source
Branch to move (defaults to current branch).
gt parent
gt pop
gt pr [branch]
[branch] (optional)
A branch name or PR number to open.
--stack
Open the stack page.
gt rebase [args..]
[args] (optional)
git rebase arguments
gt rename [name]
[name] (optional)
The new name for the current branch.
-f, --force
Allow renaming a branch that is already associated with an open GitHub pull request.
gt reorder
gt reset [args..]
[args] (optional)
git reset arguments
gt restack
--branch
Which branch to run this command from. Defaults to the current branch.
--downstack
Only restack this branch and its ancestors.
--only
Only restack this branch.
--upstack
Only restack this branch and its descendants.
gt restore [args..]
[args] (optional)
git restore arguments
gt revert [sha]
[sha]
The commit to revert.
-e, --edit
Edit the commit message.
gt split
-c, --commit, --by-commit
Split by commit - slice up the history of this branch.
-h, --hunk, --by-hunk
Split by hunk - split into new single-commit branches.
gt squash
--edit
Modify the existing commit message.
-m, --message
The updated message for the commit.
-n, --no-edit
Don’t modify the existing commit message. Takes precedence over —edit
gt submit
gt ss
is a default alias for gt submit --stack
.
--ai
Automatically AI-generate title and description for all PRs. Only works when creating new PRs. If —edit, use the generated metadata as starting points.
--always
Always push updates, even if the branch has not changed. Can be helpful for fixing an inconsistent Graphite stack view on Web/GitHub resulting from downtime/a bug.
--branch
Which branch to run this command from. Defaults to the current branch.
--cli
Edit PR metadata via the CLI instead of on web.
--comment
Add a comment on the PR with the given message.
-c, --confirm
Reports the PRs that would be submitted and asks for confirmation before pushing branches and opening/updating PRs. If either of —no-interactive or —dry-run is passed, this flag is ignored.
-d, --draft
If set, all new PRs will be created in draft mode.
--dry-run
Reports the PRs that would be submitted and terminates. No branches are restacked or pushed and no PRs are opened or updated.
-e, --edit
Input metadata for all PRs interactively. If neither —edit nor —no-edit is passed, only prompts for new PRs.
--edit-description
Input the PR description interactively. Default only prompts for new PRs. Takes precedence over —no-edit.
--edit-title
Input the PR title interactively. Default only prompts for new PRs. Takes precedence over —no-edit.
-f, --force
Force push: overwrites the remote branch with your local branch. Otherwise defaults to —force-with-lease.
--ignore-out-of-sync-trunk
Perform the submit operation even if the trunk branch is out of sync with its upstream branch. This can lead to incorrect metadata being used during the submit.
-m, --merge-when-ready
If set, marks all PRs being submitted as merge when ready, which will let them automatically merge as soon as all merge requirements are met.
--no-ai
Don’t use AI to generate any PR fields. Takes precedence over —ai.
-n, --no-edit
Don’t edit any PR fields inline. Takes precedence over —edit.
--no-edit-description
Don’t prompt for the PR description. Takes precedence over —edit-description and —edit.
--no-edit-title
Don’t prompt for the PR title. Takes precedence over —edit-title and —edit.
-p, --publish
If set, publishes all PRs being submitted.
--rerequest-review
Rerequest review from current reviewers.
--restack
Restack branches before submitting. If there are conflicts, output the branch names that could not be restacked
-r, --reviewers
If set without an argument, prompt to manually set reviewers. Alternatively, accepts a comma separated string of reviewers
-s, --stack
Submit descendants of the current branch in addition to its ancestors.
--target-trunk
Which trunk to open PRs against on remote. Defaults to the target trunk for the current local trunk (defined in gt config
), or the current local trunk if no target trunk is configured.
-t, --team-reviewers
Comma separated list of team slugs. You can either pass “slug” to this flag or “org/slug” to the reviewers flag. Will enable the —reviewers prompt if set without arguments.
-u, --update-only
Only push branches and update PRs for branches that already have PRs open.
-v, --view
Open the PR in your browser after submitting.
-w, --web
Open a web browser to edit PR metadata, even if no new PRs are being created or if configured to edit PR metadata via the CLI.
gt sync
-a, --all
Sync branches across all configured trunks.
-f, --force
Don’t prompt for confirmation before overwriting or deleting a branch in any place where confirmation is requested.
--restack
Restack any branches that can be restacked without conflicts (true by default; skip with —no-restack).
gt top
gt track [branch]
[branch] (optional)
Branch to begin tracking. Defaults to the current branch.
-f, --force
Sets the parent to the most recent tracked ancestor of the branch being tracked to skip prompts. Takes precedence over —parent
-p, --parent
The tracked branch’s parent. Must be set to a tracked branch. If provided, only one branch can be tracked at a time.
gt trunk
--add
Add an additional trunk.
-a, --all
Show all configured trunks.
gt undo
-f, --force
Do not prompt for confirmation; undo the most recent command immediately.
gt unlink [branch]
[branch] (optional)
The branch to unlink.
gt untrack [branch]
[branch] (optional)
Branch to stop tracking.
-f, --force
Will not prompt for confirmation before untracking a branch with children.
gt up [steps]
-n, --steps
The number of levels to traverse upstack.