Skip to content
LatchkeyLatchkey home

gt submit: Submit a Graphite Stack of PRs

gt submit pushes every branch in the current Graphite stack and creates or updates a GitHub PR for each one.

Graphite (gt) manages stacked branches. gt submit is the command that turns your local stack into a chain of PRs on GitHub, updating existing ones on re-run.

What it does

gt submit pushes the branches in your stack and opens a PR per branch (or updates the existing PR), wiring each PR base to the branch below it. --stack submits the whole stack; without it only the current branch and its ancestors are submitted.

Common usage

Terminal
# submit the whole stack non-interactively
gt submit --stack --no-interactive
# open all as drafts
gt submit --stack --draft --no-interactive

Options

FlagWhat it does
--stack / -sSubmit every branch in the stack, not just ancestors
--no-interactiveNever prompt; fail instead of asking (for CI)
--draftOpen new PRs as drafts
--publishMark drafts as ready
--update-onlyOnly update existing PRs, do not create new ones
--no-editDo not open an editor for titles/bodies

In CI

Always pass --no-interactive so gt fails fast instead of prompting. gt authenticates through the GitHub token from gt auth; in CI set the token via the environment (GRAPHITE handles the GitHub PAT) rather than an interactive gt auth flow. gt still needs a valid GitHub token with repo scope to push and open PRs.

Common errors in CI

"not authenticated" or "Please authenticate with gt auth" means no Graphite/GitHub token is configured. "This action is not supported in non-interactive mode" means gt hit a prompt with --no-interactive set; provide the missing value via a flag. "failed to push" usually means the branch is behind or the token lacks write access.

Using this in CI

CI checkouts are shallow and detached by default, which changes the answer this command gives you. Commands that read history, branch names, or tags need the checkout configured for it.

.github/workflows/ci.yml
- uses: actions/checkout@v4
  with:
    fetch-depth: 0   # history, tags, and git describe all need this

- run: |
    git rev-parse --is-shallow-repository   # expect false
    git rev-parse --abbrev-ref HEAD          # prints HEAD when detached

Frequently asked questions

gt submit: Submit a Graphite Stack of PRs?
Graphite (gt) manages stacked branches. gt submit is the command that turns your local stack into a chain of PRs on GitHub, updating existing ones on re-run.
What it does?
gt submit pushes the branches in your stack and opens a PR per branch (or updates the existing PR), wiring each PR base to the branch below it. --stack submits the whole stack; without it only the current branch and its ancestors are submitted.
In CI?
Always pass --no-interactive so gt fails fast instead of prompting. gt authenticates through the GitHub token from gt auth; in CI set the token via the environment (GRAPHITE handles the GitHub PAT) rather than an interactive gt auth flow. gt still needs a valid GitHub token with repo scope to push and open PRs.
Common errors in CI?
"not authenticated" or "Please authenticate with gt auth" means no Graphite/GitHub token is configured. "This action is not supported in non-interactive mode" means gt hit a prompt with --no-interactive set; provide the missing value via a flag. "failed to push" usually means the branch is behind or the token lacks write access.

Related guides

References

Run this faster and cheaper on Latchkey managed runners - self-healing included. Start free → 30-day trial · No credit card