You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/content/docs/reference/cli.md
+52-52Lines changed: 52 additions & 52 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -223,6 +223,34 @@ gh stack modify --continue
223
223
gh stack modify --abort
224
224
```
225
225
226
+
### `gh stack unstack`
227
+
228
+
Remove a stack from local tracking and delete it on GitHub. Also available as `gh stack delete`.
229
+
230
+
```sh
231
+
gh stack unstack [flags]
232
+
```
233
+
234
+
You must have a branch from the stack checked out locally. The command targets the active stack — the one that contains the currently checked out branch.
235
+
236
+
Deletes the stack on GitHub first, if it exists, then removes it from local tracking. If the remote deletion fails, the local state is left untouched so you can retry. Use `--local` to skip the remote deletion and only remove local tracking.
237
+
238
+
This is useful when you need to restructure a stack — remove a branch, reorder branches, rename branches, or make other large changes. After unstacking, use `gh stack init --adopt` to re-create the stack with the desired structure.
239
+
240
+
| Flag | Description |
241
+
|------|-------------|
242
+
|`--local`| Only delete the stack locally (keep it on GitHub) |
243
+
244
+
**Examples:**
245
+
246
+
```sh
247
+
# Delete the stack on GitHub and remove local tracking
248
+
gh stack unstack
249
+
250
+
# Only remove local tracking
251
+
gh stack unstack --local
252
+
```
253
+
226
254
---
227
255
228
256
## Remote Operations
@@ -345,34 +373,6 @@ gh stack push
345
373
gh stack push --remote upstream
346
374
```
347
375
348
-
### `gh stack unstack`
349
-
350
-
Remove a stack from local tracking and delete it on GitHub. Also available as `gh stack delete`.
351
-
352
-
```sh
353
-
gh stack unstack [flags]
354
-
```
355
-
356
-
You must have a branch from the stack checked out locally. The command targets the active stack — the one that contains the currently checked out branch.
357
-
358
-
Deletes the stack on GitHub first, if it exists, then removes it from local tracking. If the remote deletion fails, the local state is left untouched so you can retry. Use `--local` to skip the remote deletion and only remove local tracking.
359
-
360
-
This is useful when you need to restructure a stack — remove a branch, reorder branches, rename branches, or make other large changes. After unstacking, use `gh stack init --adopt` to re-create the stack with the desired structure.
361
-
362
-
| Flag | Description |
363
-
|------|-------------|
364
-
|`--local`| Only delete the stack locally (keep it on GitHub) |
365
-
366
-
**Examples:**
367
-
368
-
```sh
369
-
# Delete the stack on GitHub and remove local tracking
370
-
gh stack unstack
371
-
372
-
# Only remove local tracking
373
-
gh stack unstack --local
374
-
```
375
-
376
376
### `gh stack link`
377
377
378
378
Link PRs into a stack on GitHub without local tracking.
@@ -417,6 +417,30 @@ Move between branches in the current stack without having to remember branch nam
417
417
418
418
All 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.
419
419
420
+
### `gh stack switch`
421
+
422
+
Interactively switch to another branch in the stack.
423
+
424
+
```sh
425
+
gh stack switch
426
+
```
427
+
428
+
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.
429
+
430
+
Requires an interactive terminal.
431
+
432
+
**Examples:**
433
+
434
+
```sh
435
+
gh stack switch
436
+
# → Select a branch in the stack to switch to
437
+
# 5. frontend
438
+
# 4. api-endpoints
439
+
# 3. auth-layer
440
+
# 2. db-schema
441
+
# 1. config-setup
442
+
```
443
+
420
444
### `gh stack up`
421
445
422
446
Move up toward the top of the stack (away from trunk).
@@ -471,30 +495,6 @@ gh stack bottom
471
495
472
496
Checks out the branch closest to the trunk.
473
497
474
-
### `gh stack switch`
475
-
476
-
Interactively switch to another branch in the stack.
477
-
478
-
```sh
479
-
gh stack switch
480
-
```
481
-
482
-
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.
0 commit comments