Graphite Branch Creation
Background
Graphite is a CLI tool and web platform for managing stacked pull requests. It wraps git and provides commands like gt create, gt submit, and gt sync to make working with stacks of dependent PRs easier. Stacked PRs help break large changes into smaller, reviewable pieces while maintaining dependencies between them.
Context
- •Current git status: !
git status - •Current git diff (staged and unstaged): !
git diff HEAD - •Current branch: !
git branch --show-current - •Recent commits on this branch: !
git log --oneline -5
Your task
Create a new Graphite branch with the current changes using gt create.
Run gt create with:
- •
-aflag to stage all changes (no need for separategit add) - •
--no-interactiveflag - •A commit message
Note: When surgically staging specific files or hunks, use git add manually instead of -a.
Commit message guidelines
- •Write a clear, concise commit message based on the staged changes
- •First line should be a short summary (50 chars or less ideally)
- •If more context is needed, include a body separated by a blank line
Multiline commit messages
Use bash's $'...' syntax to embed literal newlines in the commit message. This properly interprets \n as actual newlines:
gt create -a --no-interactive -m $'Short summary of changes\n\nLonger explanation of why this change was made, any relevant context, etc.\n\n- Bullet points work too'
Skipping hooks
To skip pre-commit hooks, use --no-verify. Note that Graphite uses --no-verify, not -n (which is what git commit uses).
Command format
# Stage all changes gt create -a --no-interactive --no-verify -m $'summary\n\noptional body' # Or stage specific files first git add src/foo.ts src/bar.ts && gt create --no-interactive --no-verify -m $'summary'
If the user provided specific instructions via $ARGUMENTS, incorporate them into the commit message. Otherwise, derive an appropriate message from the changes.
User instructions: $ARGUMENTS