You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+35-13Lines changed: 35 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,11 +34,14 @@ gh stack add auth-layer
34
34
gh stack add api-endpoints
35
35
# ... make commits ...
36
36
37
-
# Push all branches and create/update PRs
37
+
# Push all branches
38
38
gh stack push
39
39
40
40
# View the stack
41
41
gh stack view
42
+
43
+
# Open a stack of PRs
44
+
gh stack submit
42
45
```
43
46
44
47
## How it works
@@ -253,32 +256,51 @@ gh stack sync
253
256
254
257
### `gh stack push`
255
258
256
-
Push all branches in the current stack and create or update pull requests.
259
+
Push all branches in the current stack to the remote.
257
260
258
261
```
259
262
gh stack push [flags]
260
263
```
261
264
262
-
Pushes every branch to the remote, then for each branch either creates a new PR (with the correct base branch) or updates the base of an existing PR if it has changed. Uses `--force-with-lease` by default to safely update rebased branches.
265
+
Pushes every branch to the remote using `--force-with-lease --atomic`. This is a lightweight wrapper around `git push` that knows about all branches in the stack. It does not create or update pull requests — use `gh stack submit` for that.
266
+
267
+
| Flag | Description |
268
+
|------|-------------|
269
+
|`--remote <name>`| Remote to push to (defaults to auto-detected remote) |
270
+
271
+
**Examples:**
272
+
273
+
```sh
274
+
gh stack push
275
+
gh stack push --remote upstream
276
+
```
277
+
278
+
### `gh stack submit`
279
+
280
+
Push all branches and create/update PRs and the stack on GitHub.
281
+
282
+
```
283
+
gh stack submit [flags]
284
+
```
285
+
286
+
Creates a Stacked PR for every branch in the stack, pushing branches to remote if needed.
263
287
264
-
After creating PRs, `push` automatically creates a **Stack** on GitHub to link the PRs together. If the stack already exists on GitHub (e.g., from a previous push), it is left as-is — updating existing stacks will be supported in an upcoming release.
288
+
After creating PRs, `submit` automatically creates a **Stack** on GitHub to link the PRs together. If the stack already exists on GitHub (e.g., from a previous submit), new PRs will be added to the top of the stack.
265
289
266
290
When creating new PRs, you will be prompted to enter a title for each one. Press Enter to accept the default (branch name), or use `--auto` to skip prompting entirely.
267
291
268
292
| Flag | Description |
269
293
|------|-------------|
270
294
|`--auto`| Use auto-generated PR titles without prompting |
271
295
|`--draft`| Create new PRs as drafts |
272
-
|`--skip-prs`| Push branches without creating or updating PRs |
273
296
|`--remote <name>`| Remote to push to (defaults to auto-detected remote) |
274
297
275
298
**Examples:**
276
299
277
300
```sh
278
-
gh stack push
279
-
gh stack push --auto
280
-
gh stack push --draft
281
-
gh stack push --skip-prs
301
+
gh stack submit
302
+
gh stack submit --auto
303
+
gh stack submit --draft
282
304
```
283
305
284
306
### `gh stack view`
@@ -401,8 +423,8 @@ gh stack add auth-middleware
401
423
gh stack add api-routes
402
424
# ... write code, make commits ...
403
425
404
-
# 4. Push everything and create PRs
405
-
gh stack push
426
+
# 4. Push everything and create Stacked PRs
427
+
gh stack submit
406
428
407
429
# 5. Reviewer requests changes on the first PR
408
430
gh stack bottom
@@ -411,7 +433,7 @@ gh stack bottom
411
433
# 6. Rebase the rest of the stack on top of your fix
# → feat/02 already has commits, creates feat/03 and commits there
453
475
454
476
# 7. Push everything and create PRs
455
-
gh stack push
477
+
gh stack submit
456
478
```
457
479
458
480
Compared to the typical workflow, there's no need to name branches, run `git add`, or run `git commit` separately. Each `gh stack add -Am "..."` does it all.
0 commit comments