.cursor/commands/gt-workflow.md
Use Graphite (gt) instead of git for ALL branch and commit operations in this repository.
gt Instead of gitAll git commands work with gt. Always use gt instead of git:
gt add <files> # instead of git add
gt commit # instead of git commit
gt status # instead of git status
gt diff # instead of git diff
# etc.
For branch/push operations, use the Graphite-specific commands:
gt create <branch-name> -m "message" instead of git branch + git commitgt submit --no-edit instead of git push| Command | Description |
|---|---|
gt add <files> | Stage files for commit |
gt create <branch-name> -m "message" | Create a new branch with commit |
gt modify -a --no-edit | Stage all and amend current branch's commit |
gt checkout <branch> | Switch branches |
gt sync | Sync and restack all branches |
gt submit --no-edit | Push and create/update PRs |
gt log short | View stack status |
CRITICAL: Always stage changes BEFORE running gt create. The command format is:
gt add <files> # Stage changes FIRST
gt create <branch-name> -m "commit message" # Then create branch with commit
If you run gt create without staged changes, it creates an empty branch with no commit. Then gt modify -a --no-edit will fail because there's no commit to amend.
If you accidentally created an empty branch:
gt add <files>
gt commit -m "commit message" # Create initial commit
gt submit --no-edit # Then submit
All PRs require a description. Use this workflow:
gt submit --no-edit
gh pr edit <pr-number> --body "Place description here"
gt stash with Graphite - causes conflicts when gt modify restacksgt checkout HEAD -- <file> after editing - silently restores unfixed versiongt modify --no-edit with unstaged/untracked files stages ALL changesgt sync pulls FROM remote, doesn't push TO remotegt modify restacks children locally but doesn't push themgt status -sb after stack operationsgt checkout parent-branch
# make edits
gt modify -a --no-edit # Stage all, amend, restack children
gt show HEAD -- <files> # VERIFY fix is in commit
gt submit --no-edit # Push immediately
gt checkout child-branch # Already restacked from gt modify
# make edits
gt modify -a --no-edit
gt show HEAD -- <files> # VERIFY
gt submit --no-edit
gt add <files>gt create <branch-name> -m "message"gt submit --no-edit.github/pull_request_template.md format: gh pr edit <pr-number> --body "..."gt instead of gitgt status -sb after stack operations