Skip to content

Commit 7fd5e09

Browse files
authored
Merge pull request #14 from github/skarim/remote-checkout
remote checkout
2 parents e4c5ab2 + e3db952 commit 7fd5e09

File tree

14 files changed

+1283
-68
lines changed

14 files changed

+1283
-68
lines changed

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# gh-stack
1+
# GitHub Stacked PRs
22

33
A GitHub CLI extension for managing stacked branches and pull requests.
44

@@ -160,23 +160,25 @@ gh stack add -m "Refactor utils" cleanup-layer
160160

161161
### `gh stack checkout`
162162

163-
Check out a locally tracked stack from a pull request number or branch name.
163+
Check out a stack from a pull request number or branch name.
164164

165165
```
166-
gh stack checkout [<pr-or-branch>]
166+
gh stack checkout [<pr-number> | <branch>]
167167
```
168168

169-
Resolves the target against stacks stored in local tracking (`.git/gh-stack`). Accepts a PR number (e.g. `42`) or a branch name that belongs to a locally tracked stack. When run without arguments in an interactive terminal, shows a menu of all locally available stacks to choose from.
169+
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.
170170

171-
> **Note:** Server-side stack discovery is not yet implemented. This command currently only works with stacks that have been created locally (via `gh stack init`). Checking out a stack that is not tracked locally will require passing in an explicit branch name or PR number once the server API is available.
171+
When a branch name is provided, the command resolves it against locally tracked stacks only.
172+
173+
When run without arguments in an interactive terminal, shows a menu of all locally available stacks to choose from.
172174

173175
**Examples:**
174176

175177
```sh
176178
# Check out a stack by PR number
177179
gh stack checkout 42
178180

179-
# Check out a stack by branch name
181+
# Check out a stack by branch name (local only)
180182
gh stack checkout feature-auth
181183

182184
# Interactive — select from locally tracked stacks

0 commit comments

Comments
 (0)