Submit
Sync branches and create/update PRs via Graphite.
Arguments
--stack— submit entire stack, not just current branch--sync-only— restack only, skip PR creation--ready— mark PR as ready (not draft)
Steps
-
Verify clean working tree
- Run
git status --porcelain - If output is non-empty → warn user about uncommitted changes and stop
- Run
-
Restack branches
- Run
gt restack --only - If exit code is non-zero → show error and stop
- Run
-
Check for sync-only mode
- If
$ARGUMENTScontains--sync-only→ stop here (restack complete)
- If
-
Build submit command
- Base:
gt submit - If
$ARGUMENTScontains--stack→ add--stack - If
$ARGUMENTScontains--ready→ add--no-draft - Default: creates draft PR (no additional flags)
- Base:
-
Execute submit
- Run the constructed command
- Capture and display output
-
Show PR URLs
- Extract and display PR URLs prominently from output
