graphite
Installation
SKILL.md
Graphite CLI Command Cheatsheet
Viewing Your Stack
| Task | Command | Short Form |
|---|---|---|
| See full information about all branches and PRs | gt log |
— |
| See all branches | gt log short |
gt ls |
Creating and Modifying Branches
| Task | Command | Short Form |
|---|---|---|
| Create a new branch | gt create |
gt c |
| Create branch, stage all, commit with message | gt create --all --message "message" |
gt c -am "message" |
| Amend staged changes to current branch | gt modify |
gt m |
| Stage all changes and amend to current branch | gt modify --all |
gt m -a |
| Add a new commit to current branch | gt modify --commit |
gt m -c |
| Stage all and add commit with message | gt modify --commit --all --message "message" |
gt m -cam "message" |
| Amend staged changes to downstack branch | gt modify --into |
gt m --into |
Syncing and Submitting
| Task | Command | Short Form |
|---|---|---|
| Pull trunk, clean up merged branches, restack | gt sync |
— |
| Push current and downstack branches, create/update PRs | gt submit |
— |
| Push all stack branches, create/update PRs | gt submit --stack |
gt ss |
| Update PRs for branches with existing PRs only | gt submit --stack --update-only |
gt ss -u |
Navigating Your Stack
| Task | Command | Short Form |
|---|---|---|
| Switch to specific branch | gt checkout |
gt co |
| Move up one branch | gt up |
gt u |
| Move down one branch | gt down |
gt d |
| Move multiple branches | gt up 3, gt down 2 |
gt u 3, gt d 2 |
| Go to top of stack | gt top |
gt t |
| Go to bottom of stack | gt bottom |
gt b |
Reorganizing Your Stack
| Task | Command | Short Form |
|---|---|---|
| Move branch to new parent | gt move |
— |
| Fold branch into parent | gt fold |
— |
| Delete branch, keep changes in working tree | gt pop |
— |
| Reorder branches in stack | gt reorder |
— |
| Split branch into multiple branches | gt split |
gt sp |
| Squash all commits in branch | gt squash |
gt sq |
| Distribute staged changes to downstack branches | gt absorb |
gt ab |
Recovery
| Task | Command |
|---|---|
| Undo most recent Graphite mutation | gt undo |
Tracking Branches
| Task | Command | Short Form |
|---|---|---|
| Start tracking existing Git branch | gt track |
gt tr |
| Stop tracking a branch | gt untrack |
gt utr |
Collaborating
| Task | Command | Short Form |
|---|---|---|
| Fetch teammate's stack locally | gt get |
— |
| Freeze branch to prevent accidental edits | gt freeze |
— |
| Unfreeze a branch | gt unfreeze |
— |
Related skills