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: README.md
+13-6Lines changed: 13 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -477,26 +477,33 @@ gh stack view --json
477
477
478
478
### `gh stack unstack`
479
479
480
-
Remove a stack from local tracking and delete it on GitHub. Also available as `gh stack delete`.
480
+
Remove a stack from local tracking and unstack it on GitHub. Also available as `gh stack delete`.
481
481
482
482
```
483
-
gh stack unstack [flags]
483
+
gh stack unstack [<stack-number>] [flags]
484
484
```
485
485
486
-
You must have an active stack checked out locally. The command targets the active stack — the one that contains the currently checked out branch.
486
+
With no argument, the command targets the active stack — the one that contains the currently checked out branch — unstacking it on GitHub and removing local tracking.
487
487
488
-
Deletes the stack on GitHub first, if it exists, then removes local tracking. Use `--local` to only remove from local tracking.
488
+
Provide a stack number (the identifier shown in the github.com stack UI) to unstack a specific stack on GitHub. This works from anywhere in the repository, whether or not the stack is checked out locally — the number is unstacked directly through the GitHub API. If the stack is also tracked locally, its local tracking is removed as well.
489
+
490
+
Use `--local` to only remove local tracking without contacting GitHub.
491
+
492
+
GitHub decides which pull requests can be unstacked: PRs that are queued for merge or have auto-merge enabled are left stacked. When some pull requests remain stacked, the stack is kept (and local tracking, if any, is unchanged).
489
493
490
494
| Flag | Description |
491
495
|------|-------------|
492
-
|`--local`| Only delete the stack locally (keep it on GitHub) |
496
+
|`--local`| Only remove the stack locally (keep it on GitHub) |
493
497
494
498
**Examples:**
495
499
496
500
```sh
497
-
# Remove the stack from local tracking and GitHub
501
+
# Remove the current stack from local tracking and GitHub
0 commit comments