Skip to content

Commit 9d1db67

Browse files
committed
docs on rebase stack button behavior
1 parent d86cfa4 commit 9d1db67

3 files changed

Lines changed: 16 additions & 2 deletions

File tree

docs/src/content/docs/faq.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ Yes. There must be a **fully linear history** between each of the branches in th
113113
If the stack is not linear (e.g., after changes were pushed to a lower branch), you can fix it in two ways:
114114

115115
- **From the CLI** — Run `gh stack rebase` to perform a cascading rebase locally and then push with `gh stack push`.
116-
- **From the UI** — Click the **Rebase Stack** button in the merge box to trigger a cascading rebase across all branches in the stack.
116+
- **From the UI** — Click the **Rebase Stack** button in the merge box to trigger a server-side cascading rebase. This rebases the entire stack on top of the latest trunk, updates every unmerged branch on top of its base branch, and force-pushes the results. See [Rebasing from the UI](/gh-stack/guides/ui/#rebasing-from-the-ui) for details.
117117

118118
## Merging Stacked PRs
119119

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,20 @@ Before a PR in the stack can be merged, the following conditions must be met:
7777

7878
![Merge box for a stacked pull request](../../../assets/screenshots/stack-merge-box.png)
7979

80+
## Rebasing from the UI
81+
82+
When the stack is not linear (e.g., after changes were pushed to a lower branch, or after `main` has moved ahead), a **Rebase Stack** button appears in the merge box. Clicking it triggers a server-side cascading rebase that:
83+
84+
1. Rebases the entire stack on top of the latest trunk (e.g., `main`) HEAD.
85+
2. Rebases every unmerged branch on top of the latest changes from its base branch, working from the bottom of the stack upward.
86+
3. Force-pushes each rebased branch to update the remote.
87+
88+
After the rebase completes, all PRs in the stack reflect the updated branches and CI checks are re-triggered.
89+
90+
:::note[Commit signing]
91+
Commits created by a server-side rebase are **not signed**. If your repository requires signed commits, we recommend using the CLI. Running `gh stack rebase` uses local git operations, so the generated commits will follow your local git signing configuration. After rebasing locally, you can force push your updated branches with `gh stack push`.
92+
:::
93+
8094
## Unstacking
8195

8296
If you want to reorder or reorganize the PRs in a stack, you must first dissolve the stack and then re-create it. You can unstack PRs from the UI.

docs/src/content/docs/introduction/overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ Stacks support all three merge methods:
7474

7575
Rebasing is the trickiest part of working with Stacked PRs, and GitHub handles it automatically:
7676

77-
- **In the PR UI** — A rebase button lets you trigger a cascading rebase across all branches in the stack.
77+
- **In the PR UI** — A **Rebase Stack** button lets you trigger a server-side cascading rebase. It rebases the entire stack on top of the latest trunk, updates every unmerged branch, and force-pushes the results. See [Rebasing from the UI](/gh-stack/guides/ui/#rebasing-from-the-ui) for details.
7878
- **From the CLI**`gh stack rebase` performs the same cascading rebase locally.
7979
- **After partial merges** — When you merge a PR at the bottom of the stack, the remaining branches are automatically rebased so the next PR targets `main` and is ready for review and merge.
8080
- **Safe squash-merge handling** — Squash merges are fully supported. The rebase engine safely replays your unique commits on top of the squashed base, avoiding artificial merge conflicts. See the [FAQ](/gh-stack/faq/#how-does-squash-merge-work) for a detailed description of how this works.

0 commit comments

Comments
 (0)