Commands
| Command | Description |
|---|---|
gx up | Move to the child branch (one level up the stack) |
gx down | Move to the parent branch (one level down the stack) |
gx top | Jump to the top of the stack (leaf branch) |
gx bottom | Jump to the bottom of the stack (first branch above trunk) |
gx up
Moves to the child branch. If the current branch has exactly one child, switches to it:
gx switch:
gx down
Moves to the parent branch:
gx top
Jumps to the leaf of the stack (the topmost branch with no children):
gx bottom
Jumps to the first branch in the stack (the one directly above trunk):
Fork Handling
All four navigation commands handle forks (branches with multiple children) gracefully:gx upandgx topstop at forks and list the optionsgx downandgx bottomalways have a single path (each branch has exactly one parent)- Cycle detection prevents infinite loops from corrupted configs
All navigation commands warn if you have uncommitted changes:
WARN You have uncommitted changes. They may conflict with the target branch.Details
Details
- Navigation uses the stack config (
.git/gx/stack.json) to determine parent/child relationships gx topwalks up from the current branch, following single children until reaching a leaf or forkgx bottomwalks down from the current branch toward trunk, stopping at the first branch whose parent is trunk- All commands include cycle detection to handle corrupted stack configs safely
- If gx detects a cycle, it prints
WARN Cycle detected in stack config.and stops