Documentation
Quick Start
Initialize gs, create your first stack, and navigate it.
Initialize gs
In any git repository, run:
gs initThis sets up gs configuration and identifies your trunk branch (usually main or master).
Create your first stack
# Create a new stacked branch off trunk
gs create feat-auth
# Make changes and commit
git add . && git commit -m "Add authentication"
# Create another branch on top
gs create feat-auth-ui
# Make changes and commit
git add . && git commit -m "Add auth UI components"Visualize the stack
gs logOutput looks like:
● *main (trunk) [fe9d15f]
├── feat-auth [a1cb412]
│ └── feat-auth-ui [b2de523]
Navigate the stack
gs up # Move to child branch
gs down # Move to parent branch
gs top # Jump to top of stack
gs bottom # Jump to trunkRestack after parent changes
If you modify a parent branch, restack to keep children in sync:
gs stack restackWhat just happened?
You created a stack of two branches where feat-auth-ui depends on feat-auth, which depends on main. gs tracks these parent-child relationships so you can navigate by structure instead of remembering branch names. When a parent branch changes, gs stack restack rebases all children automatically, keeping the entire stack up to date.