Loading...
Loading...
Work with Graphite (gt) for stacked PRs - creating, navigating, and managing PR stacks.
npx skill4agent add withgraphite/agent-skills graphitegt| I want to... | Command |
|---|---|
| Create a new branch/PR | |
| Amend current branch | |
| Navigate up the stack | |
| Navigate down the stack | |
| Jump to top of stack | |
| Jump to bottom of stack | |
| View stack structure | |
| Submit stack for review | |
| Rebase stack on trunk | |
| Change branch parent | |
| Rename current branch | |
| Move branch in stack | |
terse-stack-feature-name/terse-description-of-changeauth-bugfix/reorder-args
auth-bugfix/improve-logging
auth-bugfix/improve-documentation
auth-bugfix/handle-401-status-codesgit add <files>gt create branch-name -m "commit message"gt submit --no-interactivegt branch infogt track -p maingt creategt checkout <first-branch-of-your-stack>
gt track -p main
gt restackgit stashgit checkout main && git pullgit checkout -b temp-working && git stash popgt track -p maingt create# Move up one branch (toward top of stack)
gt up
# Move down one branch (toward trunk)
gt down
# Jump to top of stack
gt top
# Jump to bottom of stack (first branch above trunk)
gt bottom
# View the full stack structure
gt lsgit add <files>
gt modify -m "updated commit message"gt movegt create --insert# Go to first branch of your stack
gt checkout <first-branch>
# Change its parent to main
gt track --parent main
# Rebase the entire stack
gt restackgt rename new-branch-name# Reset the last commit, keeping changes unstaged
git reset HEAD^
# Reset multiple commits (e.g., last 2 commits)
git reset HEAD~2
# View the diff to understand what you're working with
git diff HEADgt submitmaingt lsmaingt checkout <first-branch>
gt track -p main
gt restackgt modifygt submit --no-interactivegh pr editWrite/tmp/pr-body.mdgh pr edit--body-filegh pr edit <PR_NUMBER> --title "stack-name: description" --body-file /tmp/pr-body.md## Stack Context
This stack adds a warning on the merge button when users are bypassing GitHub rulesets.
## Why?
Users who can bypass rulesets (via org admin or team membership) currently see no indication
they're circumventing branch protection. This PR threads the bypass data from the server to
enable the frontend warning (PR 2) to display it.| Problem | Solution |
|---|---|
| "Cannot perform this operation on untracked branch" | Run |
| Stack parented on wrong branch | Use |
| Need to reorder PRs | Use |
| Conflicts during restack | Resolve conflicts, then |
| Want to split a PR | Reset commits ( |
| Need to delete a branch (non-interactive) | |
| Use targeted |
| Rebase interrupted mid-conflict | Check if files are resolved but unstaged, then |
gt restackgit rebasegt restackgit rebasegt restack# 1. Checkout the branch you want to rebase
git checkout my-feature-branch
# 2. Rebase onto the target (e.g., updated parent branch)
git rebase target-branch
# 3. If you hit conflicts:
# - Resolve the conflict in the file
# - Stage it: git add <file>
# - Continue: git rebase --continue
# 4. If a commit is obsolete and should be skipped:
git rebase --skip
# 5. After rebase, use gt modify to sync graphite's tracking
gt modify --no-editgit status
# Look for "interactive rebase in progress" and "Unmerged paths"git add <resolved-files>
git rebase --continue# Delete a branch (non-interactive, even if not merged)
gt delete branch-to-delete -f -q
# Also delete all children (upstack)
gt delete branch-to-delete -f -q --upstack
# Also delete all ancestors (downstack)
gt delete branch-to-delete -f -q --downstack-f--force-q--quiet--no-interactivegt checkout child-branch
gt track --parent new-parent-branch