Graphite fully supports multiple Git worktrees. Starting in
gt version 1.8.4, Graphite does not modify branches checked out in another worktree in most cases. See Work in multiple Git worktrees for details.Viewing your stack
| Task | Command | Short Form |
|---|---|---|
| See full information about your branches, PRs, and worktree locations | gt log | |
| See all of your branches | gt log short | gt ls |
Creating and modifying branches
| Task | Command | Short Form |
|---|---|---|
| Create a new branch | gt create | gt c |
| Create a branch on top of a branch checked out in another worktree | gt create --onto <branch> | |
| Create a 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 them to current branch | gt modify --all | gt m -a |
| Add a new commit to current branch | gt modify --commit | gt m -c |
| Stage all changes and add a new commit to current branch with message | gt modify --commit --all --message "message" | gt m -cam "message" |
| Amend staged changes to a 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 branch and all downstack branches to remote and create/update PRs | gt submit | |
| Push all branches in current stack to remote and create/update PRs | gt submit --stack | gt ss |
| Only push branches and update PRs for branches that already have PRs open | gt submit --stack --update-only | gt ss -u |
Navigating your stack
Reorganizing your stack
| Task | Command | Short Form |
|---|---|---|
| Move branch to a new parent | gt move | |
| Fold branch into its parent | gt fold | |
| Delete branch but keep changes in working tree | gt pop | |
| Reorder branches in your stack | gt reorder | |
| Split branch into multiple branches | gt split | gt sp |
| Squash all commits in branch into one | gt squash | gt sq |
| Distribute staged changes to downstack branches by amending relevant commits | gt absorb | gt ab |
Recovery
| Task | Command | Short Form |
|---|---|---|
| Undo the most recent Graphite mutation | gt undo |
Tracking branches
| Task | Command | Short Form |
|---|---|---|
| Start tracking an existing Git branch with Graphite | gt track | gt tr |
| Stop tracking a branch | gt untrack | gt utr |
Collaborating
| Task | Command | Short Form |
|---|---|---|
| Fetch a teammate’s stack locally | gt get | |
| Freeze a branch to prevent accidental edits | gt freeze | |
| Unfreeze a branch | gt unfreeze |