Skip to content

Commit c348c63

Browse files
committed
add switch to docs
1 parent 33214db commit c348c63

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,7 @@ gh stack up [n] # Move up n branches (default 1)
418418
gh stack down [n] # Move down n branches (default 1)
419419
gh stack top # Jump to the top of the stack
420420
gh stack bottom # Jump to the bottom of the stack
421+
gh stack switch # Interactively pick a branch to switch to
421422
```
422423

423424
Navigation commands clamp to the bounds of the stack — moving up from the top or down from the bottom is a no-op with a message. If you're on the trunk branch, `up` moves to the first stack branch.
@@ -430,6 +431,7 @@ gh stack up 3 # move up three layers
430431
gh stack down
431432
gh stack top
432433
gh stack bottom
434+
gh stack switch # shows an interactive picker
433435
```
434436

435437
### `gh stack feedback`

docs/src/content/docs/reference/cli.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,30 @@ gh stack bottom
410410

411411
Checks out the branch closest to the trunk.
412412

413+
### `gh stack switch`
414+
415+
Interactively switch to another branch in the stack.
416+
417+
```sh
418+
gh stack switch
419+
```
420+
421+
Shows an interactive picker listing all branches in the current stack, ordered from top (furthest from trunk) to bottom (closest to trunk) with their position number. Select a branch to check it out.
422+
423+
Requires an interactive terminal.
424+
425+
**Examples:**
426+
427+
```sh
428+
gh stack switch
429+
# → Select a branch in the stack to switch to
430+
# 5. frontend
431+
# 4. api-endpoints
432+
# 3. auth-layer
433+
# 2. db-schema
434+
# 1. config-setup
435+
```
436+
413437
---
414438

415439
## Utilities

0 commit comments

Comments
 (0)