Skip to content

Commit 5867a30

Browse files
committed
unstacking behavior clarification
1 parent b1f0eab commit 5867a30

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

‎docs/src/content/docs/faq.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ gh stack init db-migrations api-routes frontend
5252

5353
**From the CLI** — Run `gh stack unstack` (or `gh stack delete`) to delete the stack on GitHub and remove local tracking. You can also unstack any stack by its number from anywhere in the repository — `gh stack unstack 7` — whether or not it's checked out locally. Use `--local` to only remove local tracking.
5454

55-
**From the UI** — You can unstack PRs from the GitHub UI — see [Unstacking](/gh-stack/guides/ui/#unstacking) for a walkthrough. This dissolves the association between PRs, turning them back into standard independent PRs.
55+
**From the UI** — You can unstack PRs from the GitHub UI — see [Unstacking](/gh-stack/guides/ui/#unstacking) for a walkthrough. This dissolves the association between the PRs, turning them back into standard independent PRs.
56+
57+
Unstacking only removes **open, draft, and closed** PRs from the stack. **Merged and queued PRs remain part of the stack** — once a PR has merged (or is queued for merge) as part of a stack, it can't be unstacked. A stack is fully dissolved only when none of its PRs have merged or are queued for merge; otherwise it persists with those PRs still in it.
5658

5759
### Can stacks be created across forks?
5860

‎docs/src/content/docs/guides/ui.md‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,12 @@ Commits created by a server-side rebase are **not signed**. If your repository r
9999

100100
If you want to reorder or reorganize the PRs in a stack from the UI, you must first dissolve the stack and then re-create it. For CLI users, `gh stack modify` provides an interactive way to [restructure a stack](/gh-stack/guides/modify/) — including reordering, inserting, dropping, and renaming branches — without needing to dissolve it.
101101

102-
### Dissolving the Entire Stack
102+
### Dissolving the Stack
103103

104-
To dissolve the stack entirely (turning all Stacked PRs back into independent PRs), use the unstack option on the stack itself.
104+
To dissolve the stack, use the Unstack option on the stack.
105105

106106
![Dissolving an entire stack](../../../assets/screenshots/unstack-entire-stack.png)
107107

108-
After unstacking, each PR retains its current base branch but is no longer linked to the other PRs. The stack map and stack-related merge requirements disappear from all affected PRs.
108+
Unstacking removes the **open, draft, and closed** PRs from the stack. Each of those PRs keeps its current base branch but is no longer linked to the others, and the stack map and stack-related merge requirements disappear from them.
109+
110+
**Merged and queued PRs stay in the stack.** Once a PR has merged — or is queued for merge — as part of a stack, it remains part of that stack and can't be unstacked. So if every PR in the stack is open, draft, or closed, unstacking removes them all and the stack is dissolved entirely; if any PR has already merged or is queued for merge, the stack persists with those PRs still in it.

0 commit comments

Comments
 (0)