Skip to content

Commit 764d448

Browse files
committed
update docs
1 parent fccf9ba commit 764d448

3 files changed

Lines changed: 21 additions & 9 deletions

File tree

‎README.md‎

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,13 +165,13 @@ gh stack add -m "Refactor utils" cleanup-layer
165165

166166
### `gh stack checkout`
167167

168-
Check out a stack from a pull request number or branch name.
168+
Check out a stack from a pull request number, URL, or branch name.
169169

170170
```
171-
gh stack checkout [<pr-number> | <branch>]
171+
gh stack checkout [<pr-number> | <pr-url> | <branch>]
172172
```
173173

174-
When a PR number is provided (e.g. `123`), the command fetches the stack on GitHub, pulls the branches, and sets up the stack locally. If the stack already exists locally and matches, it switches to the branch. If the local and remote stacks have different compositions, you'll be prompted to resolve the conflict.
174+
When a PR number or URL is provided (e.g. `123` or `https://github.com/owner/repo/pull/123`), the command fetches the stack on GitHub, pulls the branches, and sets up the stack locally. If the stack already exists locally and matches, it switches to the branch. If the local and remote stacks have different compositions, you'll be prompted to resolve the conflict.
175175

176176
When a branch name is provided, the command resolves it against locally tracked stacks only.
177177

@@ -183,6 +183,9 @@ When run without arguments in an interactive terminal, shows a menu of all local
183183
# Check out a stack by PR number
184184
gh stack checkout 42
185185

186+
# Check out a stack by PR URL
187+
gh stack checkout https://github.com/owner/repo/pull/42
188+
186189
# Check out a stack by branch name (local only)
187190
gh stack checkout feature-auth
188191

@@ -389,7 +392,7 @@ Link PRs into a stack on GitHub without local tracking.
389392
gh stack link [flags] <branch-or-pr> <branch-or-pr> [...]
390393
```
391394

392-
Creates or updates a stack on GitHub from branch names or PR numbers. This command does not store or modify any `gh stack` local tracking state. It is designed for users who manage branches with other tools locally (e.g., jj, Sapling, git-town) and want to simply open a stack of PRs.
395+
Creates or updates a stack on GitHub from branch names or PR numbers/URLs. This command does not store or modify any `gh stack` local tracking state. It is designed for users who manage branches with other tools locally (e.g., jj, Sapling, git-town) and want to simply open a stack of PRs.
393396

394397
Arguments are provided in stack order (bottom to top). Branch arguments are automatically pushed to the remote before creating or looking up PRs. For branches that already have open PRs, those PRs are used. For branches without PRs, new PRs are created automatically with the correct base branch chaining. Existing PRs whose base branch doesn't match the expected chain are corrected automatically.
395398

@@ -410,6 +413,9 @@ gh stack link feature-auth feature-api feature-ui
410413
# Link existing PRs by number
411414
gh stack link 10 20 30
412415

416+
# Link existing PRs by URL
417+
gh stack link https://github.com/owner/repo/pull/10 https://github.com/owner/repo/pull/20
418+
413419
# Add branches to an existing stack of PRs
414420
gh stack link 42 43 feature-auth feature-ui
415421

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ While the PR UI provides the review and merge experience, the `gh stack` CLI han
9191
- **Syncing everything** — `gh stack sync` fetches, rebases, pushes, and updates PR state in one command.
9292
- **Restructuring stacks** — `gh stack modify` opens an interactive terminal UI to drop, fold, insert, rename, and reorder branches in a stack.
9393
- **Tearing down stacks** — `gh stack unstack` removes a stack from GitHub and local tracking.
94-
- **Checking out a stack** — `gh stack checkout <pr-number>` pulls down a stack, with all its branches, from GitHub to your local machine.
94+
- **Checking out a stack** — `gh stack checkout <pr-number|url>` pulls down a stack, with all its branches, from GitHub to your local machine.
9595

9696
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.
9797

‎docs/src/content/docs/reference/cli.md‎

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,13 +135,13 @@ gh stack view --json
135135

136136
### `gh stack checkout`
137137

138-
Check out a stack from a pull request number or branch name.
138+
Check out a stack from a pull request number, URL, or branch name.
139139

140140
```sh
141-
gh stack checkout [<pr-number> | <branch>]
141+
gh stack checkout [<pr-number> | <pr-url> | <branch>]
142142
```
143143

144-
When a PR number is provided (e.g., `123`), the command fetches the stack on GitHub, pulls the branches, and sets up the stack locally. If the stack already exists locally and matches, it switches to the branch. If the local and remote stacks have different compositions, you'll be prompted to resolve the conflict.
144+
When a PR number or URL is provided (e.g., `123` or `https://github.com/owner/repo/pull/123`), the command fetches the stack on GitHub, pulls the branches, and sets up the stack locally. If the stack already exists locally and matches, it switches to the branch. If the local and remote stacks have different compositions, you'll be prompted to resolve the conflict.
145145

146146
When a branch name is provided, the command resolves it against locally tracked stacks only.
147147

@@ -153,6 +153,9 @@ When run without arguments in an interactive terminal, shows a menu of all local
153153
# Check out a stack by PR number
154154
gh stack checkout 42
155155

156+
# Check out a stack by PR URL
157+
gh stack checkout https://github.com/owner/repo/pull/42
158+
156159
# Check out a stack by branch name (local only)
157160
gh stack checkout feature-auth
158161

@@ -391,7 +394,7 @@ Link PRs into a stack on GitHub without local tracking.
391394
gh stack link [flags] <branch-or-pr> <branch-or-pr> [...]
392395
```
393396

394-
Creates or updates a stack on GitHub from branch names or PR numbers. This command does not create or modify any `gh-stack` local tracking state. It is designed for users who manage branches with other tools locally (e.g., jj, Sapling, git-town) and want to simply open a stack of PRs.
397+
Creates or updates a stack on GitHub from branch names or PR numbers/URLs. This command does not create or modify any `gh-stack` local tracking state. It is designed for users who manage branches with other tools locally (e.g., jj, Sapling, git-town) and want to simply open a stack of PRs.
395398

396399
Arguments are provided in stack order (bottom to top). Branch arguments are automatically pushed to the remote before creating or looking up PRs. For branches that already have open PRs, those PRs are used. For branches without PRs, new PRs are created automatically with the correct base branch chaining. Existing PRs whose base branch doesn't match the expected chain are corrected automatically.
397400

@@ -412,6 +415,9 @@ gh stack link feature-auth feature-api feature-ui
412415
# Link existing PRs by number
413416
gh stack link 10 20 30
414417

418+
# Link existing PRs by URL
419+
gh stack link https://github.com/owner/repo/pull/10 https://github.com/owner/repo/pull/20
420+
415421
# Add branches to an existing stack of PRs
416422
gh stack link 42 43 feature-auth feature-ui
417423

0 commit comments

Comments
 (0)