Skip to content

Commit 5c1fe16

Browse files
authored
docs site content updates (#28)
* additional private preview callouts * squash merge clarification * home page updates * merge process clarification
1 parent c80e10c commit 5c1fe16

File tree

6 files changed

+73
-10
lines changed

6 files changed

+73
-10
lines changed

docs/src/content/docs/faq.md

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,41 @@ You cannot merge a PR in the middle of the stack before the PRs below it are mer
100100

101101
### How does squash merge work?
102102

103-
Squash merges are fully supported. Each PR in the stack produces one clean, squashed commit when merged. The rebase engine automatically detects squash-merged PRs and replays commits from the remaining branches onto the squashed result.
103+
Squash merges are fully supported. Each PR in the stack produces one clean, squashed commit when merged. Merging `n` PRs will create `n` squashed commits on the base.
104+
105+
When a PR is squash-merged, the original commits disappear from the history, which can cause artificial merge conflicts during rebasing. Both the CLI and the server handle this using `git rebase --onto`:
106+
107+
```
108+
git rebase --onto <new_commit_sha_generated_by_squash> <original_commit_sha_from_tip_of_merged_branch> <branch_name>
109+
```
110+
111+
**Example:** Consider a stack with three PRs:
112+
113+
```
114+
PR1: main ← A, B (branch1)
115+
PR2: main ← A, B, C, D (branch2)
116+
PR3: main ← A, B, C, D, E, F (branch3)
117+
```
118+
119+
When PR1 and PR2 are squash-merged, `main` now looks like:
120+
121+
```
122+
S1 (squash of A+B), S2 (squash of C+D)
123+
```
124+
125+
Then the following rebase is run:
126+
127+
```
128+
git rebase --onto S2 D branch3
129+
```
130+
131+
Which rewrites `branch3` to:
132+
133+
```
134+
S1, S2, E, F
135+
```
136+
137+
This moves the unique commits from the unmerged branch and replays them on top of the newly squashed commits on the base branch, avoiding any merge conflicts.
104138

105139
### How does merge commit work?
106140

docs/src/content/docs/getting-started/quick-start.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ description: Install the gh stack CLI and create your first Stacked PR in minute
99
- Git 2.20 or later
1010
- A GitHub repository you can push to
1111

12+
:::caution[Private Preview]
13+
Stacked PRs is currently in private preview. This feature will **not work** unless enabled for your repository. [Sign up for the waitlist →](https://gh.io/stacksbeta)
14+
:::
15+
1216
## Install the CLI Extension
1317

1418
```sh

docs/src/content/docs/guides/stacked-prs.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ Each PR in a stack shows only the diff for its layer — the changes between its
2121
- **Review individual PRs** when you're focusing on a specific concern (e.g., reviewing only the API layer).
2222
- **Use the stack map** to navigate between PRs without going back to the PR list.
2323

24-
## Merging Step by Step
24+
## Merging from the Bottom Up
2525

26-
Stacks are merged **from the bottom up**. You cannot merge a PR in the middle of the stack before the PRs below it are merged.
26+
Stacks are merged **from the bottom up** — you can merge any number of PRs at once, as long as they form a contiguous group starting from the lowest unmerged PR. For example, in a stack of four PRs, you can merge just the bottom one, or the bottom three together, but you cannot merge only the second and third PRs while leaving the first unmerged. Mid-stack merges are not allowed.
2727

28-
1. When the bottom PR meets all merge requirements, merge it.
29-
2. After the bottom PR is merged, the remaining stack is **automatically rebased** — the next PR's base is updated to target `main` directly.
30-
3. The next PR is now at the bottom and can be reviewed, approved, and merged.
28+
1. When the lowest unmerged PR (and any PRs above it that you want to include) meet all merge requirements, merge them.
29+
2. After the merge, the remaining stack is **automatically rebased** — the next unmerged PR's base is updated to target `main` directly.
30+
3. The next unmerged PR is now at the bottom and can be reviewed, approved, and merged.
3131
4. Repeat until the entire stack is landed.
3232

3333
For details on merge methods (squash, merge commit, rebase) and merge requirements, see [Merging Stacks](/gh-stack/introduction/overview/#merging-stacks) in the Overview.

docs/src/content/docs/index.mdx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ hero:
1515
icon: right-arrow
1616
---
1717

18-
import { Card, CardGrid } from '@astrojs/starlight/components';
18+
import { Card, CardGrid, Aside } from '@astrojs/starlight/components';
1919
import { Image } from 'astro:assets';
2020
import stackDiagram from '../../assets/stack-diagram.svg';
2121
import stackNavigator from '../../assets/screenshots/stack-navigator.png';
@@ -53,14 +53,18 @@ GitHub understands stacks end-to-end: the pull request UI shows a **stack map**
5353
<Image src={stackNavigator} alt="The stack navigator in a pull request header" />
5454
</div>
5555

56-
## How It Works
56+
## Working with Stacks
5757

58-
The `gh stack` CLI handles the local workflow: creating branches, managing rebases, pushing to GitHub, and creating PRs with the correct base branches. On GitHub, the PR UI gives reviewers the context they need — a stack map for navigation, focused diffs for each layer, and proper rules enforcement.
58+
**While the `gh stack` CLI makes the local workflow seamless, it is entirely optional.** You can create and manage Stacked PRs directly via the GitHub UI, the API, or your standard Git workflow. If you choose to use the CLI, it handles creating branches, managing rebases, pushing to GitHub, and creating PRs with the correct base branches. On GitHub, the PR UI gives reviewers the context they need — a stack map for navigation, focused diffs for each layer, and proper rules enforcement.
5959

60-
When you're ready to merge, you can merge all or a part of the stack. Each PR can be merged directly or through the merge queue. After a merge, the remaining PRs in the stack are automatically rebased so the lowest unmerged PR targets the base branch.
60+
When you're ready to merge, you can merge all or a part of the stack. Each PR can be merged directly or through the merge queue. **If you want to merge multiple PRs at once (e.g., the bottom two PRs in a stack), simply wait for CI to pass on those specific layers, and you can merge them in a single step.** After a merge, the remaining PRs in the stack are automatically rebased so the lowest unmerged PR targets the updated base branch.
6161

6262
## Get Started
6363

64+
<Aside type="caution" title="Private Preview">
65+
Stacked PRs is currently in private preview. This feature will **not work** unless enabled for your repository. [Sign up for the waitlist →](https://gh.io/stacksbeta)
66+
</Aside>
67+
6468
```sh
6569
# Install the CLI extension
6670
gh extension install github/gh-stack

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ Rebasing is the trickiest part of working with Stacked PRs, and GitHub handles i
7777
- **In the PR UI** — A rebase button lets you trigger a cascading rebase across all branches in the stack.
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.
80+
- **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.
8081

8182
## The CLI: `gh stack`
8283

@@ -93,6 +94,8 @@ While the PR UI provides the review and merge experience, the `gh stack` CLI han
9394

9495
The CLI is not required to use Stacked PRs — the underlying git operations are standard. But it makes the workflow simpler, and you can create Stacked PRs from the CLI instead of the UI.
9596

97+
**Bring Your Own Tools:** You don't need to use the `gh stack` CLI for your local workflow. If you use tools like Jujutsu, Sapling, or custom tools to manage and push your local branches, you can then use the CLI or the GitHub UI to open a stack of PRs from those branches. See the [FAQ](/gh-stack/faq/#will-this-work-with-a-different-tool-for-stacking) for examples.
98+
9699
## Thinking About Stack Structure
97100

98101
Each branch in a stack should represent a **discrete, logical unit of work** that can be reviewed independently. Think of a stack from the reviewer's perspective: the PRs should tell a cohesive story, where each one is a small, logical piece of the whole.

docs/src/styles/custom.css

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,16 @@ header starlight-theme-select {
248248
margin-right: auto;
249249
}
250250

251+
.hero .tagline code {
252+
font-size: 0.9em;
253+
letter-spacing: -0.02em;
254+
word-spacing: -0.1em;
255+
padding: 0.15em 0.4em;
256+
border-radius: 6px;
257+
background: rgba(110, 118, 129, 0.15);
258+
font-weight: 500;
259+
}
260+
251261
/* Center the action button group */
252262
.hero .sl-flex .sl-flex {
253263
justify-content: center !important;
@@ -596,6 +606,14 @@ a.sl-link-button[data-variant='primary']:hover,
596606
/* Code blocks and tables — let Starlight/ExpressiveCode handle layout.
597607
Colors flow through the --sl-color-* variables set above. */
598608

609+
/* Light mode copy button: make icon visible on light code blocks */
610+
:root[data-theme='light'] .expressive-code .copy button {
611+
background-color: rgba(175, 184, 193, 0.3) !important;
612+
}
613+
:root[data-theme='light'] .expressive-code .copy button::after {
614+
background-color: #1f2328 !important;
615+
}
616+
599617
/* Blockquotes — light color adjustments only */
600618
.sl-markdown-content blockquote {
601619
color: #9198a1;

0 commit comments

Comments
 (0)