Skip to content

Documentation

Creating Stacks

Branch off the current head and chain as many as you need.

gs create

Create a new branch stacked on top of the current branch. The new branch is automatically tracked with the current branch as its parent.

# Interactive mode — prompts for branch name
gs create
 
# Direct mode — specify branch name
gs create feat-auth

If you have staged changes when running gs create, you'll be prompted to commit them to the new branch.

gs track

If you already have a branch created with plain git checkout -b, you can bring it into gs:

git checkout feat-existing
gs track
# Select parent branch when prompted

Verify it's tracked:

gs info

Parent-child relationships

Every branch in a stack has exactly one parent (except trunk). When you run gs create, the current branch becomes the parent of the new branch. This relationship is what lets gs navigate, restack, and manage branches structurally.

main (trunk)
└── feat-database       ← parent of feat-api
    └── feat-api        ← parent of feat-ui
        └── feat-ui

Workflow: creating a stack of features

# Start from trunk
git checkout main
 
# Create first feature branch
gs create feat-database
# ... make changes, commit ...
 
# Create second feature stacked on first
gs create feat-api
# ... make changes, commit ...
 
# Create third feature stacked on second
gs create feat-ui
# ... make changes, commit ...
 
# View your stack
gs log

Each branch builds on the one before it. When it's time to review, each PR shows only the diff introduced by that branch, not the entire stack.