CLI Command Reference

For info about the flags and arguments of any command, just run gt <command> --help


icon

Note

The aliases listed for each command below are the shortest possible way to invoke each command. A noun-verb command can be typed all of the following ways:

  • gt branch create
  • gt b create
  • gt branch c
  • gt b c
  • gt bc

Command groupCommandAliasDescription
authAdd your auth token to enable Graphite CLI to create and update your PRs on GitHub.
branchbottombbSwitch to the first branch from trunk in the current stack.
branchcheckoutbcoSwitch to a branch.
branchcreatebcCreate a new branch stacked on top of the current branch and commit staged changes. If no branch name is specified but a commit message is passed, generate a branch name from the commit message.
branchdeletebdlDelete a branch and its corresponding Graphite metadata.
branchdownbdSwitch to the parent of the current branch.
brancheditbeRun an interactive rebase on the current branch's commits and restack upstack branches.
branchfoldbfFold a branch's changes into its parent, update dependencies of descendants of the new combined branch, and restack.
branchrenamebrnRename a branch and update metadata referencing it. Note that this removes any associated GitHub pull request.
branchrestackbrEnsure the current branch is based on its parent, rebasing if necessary.
branchinfobiDisplay information about the current branch.
branchsplitbspSplit the current branch into multiple branches.
branchsquashbsqSquash all commits in the current branch and restack upstack branches.
branchsubmitbsIdempotently force push the current branch to GitHub, creating or updating a pull request.
branchtopbtSwitch to the tip branch of the current stack. Prompts if ambiguous.
branchtrackbtrStart tracking the current branch (by default) with Graphite by selecting its parent. This command can also be used to fix corrupted Graphite metadata.
branchuntrackbutStop tracking a branch with Graphite. If the branch has children, they will also be untracked.
branchupbuSwitch to the child of the current branch. Prompts if ambiguous.
changelogShow the Graphite CLI changelog.
commitamendcaAmend the most recent commit and restack upstack branches.
commitcreateccCreate a new commit and restack upstack branches.
completionSet up bash or zsh tab completion.
continuecontContinues the most recent Graphite command halted by a merge conflict.
dashdOpen the web dashboard.
dashprdp or dprOpens the PR page for the current branch.
docsShow the Graphite CLI docs.
downstackeditdseEdit the order of the branches between trunk and the current branch, restacking all of their descendants.
downstackgetdsgGet branches from trunk to the specified branch from remote, prompting the user to resolve conflicts.
downstackrestackdsrFrom trunk to the current branch, ensure each is based on its parent, rebasing if necessary.
downstacksubmitdssIdempotently force push all branches from trunk to the current branch to GitHub, creating or updating distinct pull requests for each.
downstacktestdstFrom trunk to the current branch, run the provided command on each branch and aggregate the results.
downstacktrackdstrTrack a series of untracked branches, by specifying each branch's parent, stopping when you reach a tracked branch.
feedbackPost a string directly to the maintainers' Slack where they can factor in your feedback, laugh at your jokes, cry at your insults, or test the bounds of Slack injection attacks.
feedbackdebug-contextPrint a debug summary of your repo. Useful for creating bug report details.
loglLog all branches tracked by Graphite, showing dependencies and info for each.
logshortlsLog all stacks tracked by Graphite, arranged to show dependencies.
loglongllDisplay a graph of the commit ancestry of all branches.
repoinitriCreate or regenerate a `.graphite_repo_config` file.
reponameThe current repo's name stored in Graphite. e.g. in withgraphite/graphite-cli', this is 'graphite-cli'.
repoownerThe current repo owner's name stored in Graphite. e.g. in 'withgraphite/graphite-cli', this is 'withgraphite'.
repopr-templatesA list of your GitHub PR templates. These are used to pre-fill the bodies of your PRs created using the submit command.
reporemoteSpecifies the remote that graphite pushes to/pulls from (defaults to 'origin')
reposyncrsPull the trunk branch from remote and delete any branches that have been merged.
stackrestacksrEnsure each branch in the current stack is based on its parent, rebasing if necessary.
stacksubmitssIdempotently force push all branches in the current stack to GitHub, creating or updating distinct pull requests for each.
stackteststRun the provided command on each branch in the current stack and aggregate the results.
upstackontousoRebase the current branch onto the latest commit of target branch and restack all of its descendants.
upstackrestackusrEnsure the current branch and each of its descendants is based on its parent, rebasing if necessary.
upstacksubmitussIdempotently force push the current branch and its descendants to GitHub, creating or updating pull requests as necessary.
upstacktestustFor each of the current branch and its descendants, run the provided command and aggregate the results.
userbranch-dateToggle prepending date to auto-generated branch names on branch creation.
userbranch-prefixThe prefix which Graphite will prepend to generated branch names.
userbranch-replacementThe character that will replace unsupported characters in generated branch names.
usereditorThe editor opened by Graphite
usersubmit-bodyOptions for default PR descriptions.
usertipsShow tips while using Graphite