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: docs/src/content/docs/faq.md
+4-6Lines changed: 4 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,26 +24,24 @@ gh stack add auth-layer
24
24
# ... make commits ...
25
25
gh stack add api-routes
26
26
# ... make commits ...
27
-
gh stack push
27
+
gh stack submit
28
28
```
29
29
30
30
Or you can create stacked PRs manually by setting each PR's base branch to the branch of the PR below it.
31
31
32
32
### How do I add PRs to my stack?
33
33
34
-
Use `gh stack add <branch-name>` to add a new branch on top of the current stack. When you run `gh stack push`, a PR is created for each branch.
34
+
Use `gh stack add <branch-name>` to add a new branch on top of the current stack. When you run `gh stack submit`, a PR is created for each branch and they are linked together as a Stack on GitHub.
35
35
36
36
### How can I modify my stack?
37
37
38
38
Reordering or inserting branches into the middle of a stack is not currently supported. To restructure a stack, you need to delete it and recreate it with the desired order.
39
39
40
40
### How do I delete my stack?
41
41
42
-
Use `gh stack unstack` to remove a stack from both local tracking and GitHub, or `gh stack unstack --local` to only remove the local tracking entry.
42
+
<!-- TODO: Update once stack deletion workflow is finalized -->
43
43
44
-
### What happens when you unstack?
45
-
46
-
When you unstack, the local tracking metadata is removed. The branches and PRs on GitHub remain as-is unless you explicitly delete them. Note that auto-merge is disabled on any PR in a stack to avoid changes from one PR getting merged into another out of order.
44
+
You can unstack a stacked of PRs from the PRs UI on the web. Functionality to do this from the CLI will be coming soon.
Copy file name to clipboardExpand all lines: docs/src/content/docs/getting-started/quick-start.md
+12-4Lines changed: 12 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -59,17 +59,25 @@ git add .
59
59
git commit -m "Add API routes"
60
60
```
61
61
62
-
### 4. Push and create PRs
62
+
### 4. Push branches
63
63
64
-
Push all branches and create pull requests in one command:
64
+
Push all branches to the remote:
65
65
66
66
```sh
67
67
gh stack push
68
68
```
69
69
70
-
Each PR is created with the correct base branch — `auth-middleware` targets `main`, and `api-routes` targets `auth-middleware` — so reviewers see only the diff for that layer.
70
+
### 5. Create PRs
71
71
72
-
### 5. View the stack
72
+
Create pull requests and link them as a stack on GitHub:
73
+
74
+
```sh
75
+
gh stack submit
76
+
```
77
+
78
+
Each PR is created with the correct base branch — your first branch targets `main`, and `api-routes` targets the first branch — so reviewers see only the diff for that layer. The PRs are automatically linked together as a Stack on GitHub.
`gh stack push` uses `--force-with-lease` to safely update rebased branches. Use `gh stack submit` when you need to create new PRs or update the Stack on GitHub.
Copy file name to clipboardExpand all lines: docs/src/content/docs/guides/workflows.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,8 +20,8 @@ gh stack init
20
20
gh stack add api-routes
21
21
# ... write code, make commits ...
22
22
23
-
# 4. Push everything and create PRs
24
-
gh stack push
23
+
# 4. Push everything and create Stacked PRs
24
+
gh stack submit
25
25
26
26
# 5. Reviewer requests changes on the first PR
27
27
gh stack bottom
@@ -30,7 +30,7 @@ gh stack bottom
30
30
# 6. Rebase the rest of the stack on top of your fix
31
31
gh stack rebase
32
32
33
-
# 7. Push the updated stack
33
+
# 7. Push the updated branches
34
34
gh stack push
35
35
36
36
# 8. When the first PR is merged, sync the stack
@@ -65,8 +65,8 @@ gh stack add -Am "API routes"
65
65
gh stack add -Am "Frontend components"
66
66
# → creates feat/03
67
67
68
-
# 7. Push everything
69
-
gh stack push
68
+
# 7. Push everything and create PRs
69
+
gh stack submit
70
70
```
71
71
72
72
Each `gh stack add -Am "..."` stages all files, commits, and (if the current branch already has commits) creates a new branch — no separate `git add` or `git commit` needed.
@@ -175,5 +175,5 @@ With the skill installed, your agent can:
175
175
- Plan stack structure based on the work being done
176
176
- Create branches and commit changes in the right layers
177
177
- Navigate between branches to make mid-stack changes
Copy file name to clipboardExpand all lines: docs/src/content/docs/index.mdx
+5Lines changed: 5 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -67,7 +67,12 @@ gh stack add auth-layer
67
67
# ... make commits ...
68
68
gh stack add api-routes
69
69
# ... make commits ...
70
+
71
+
# Push all branches
70
72
gh stack push
73
+
74
+
# Open a stack of PRs
75
+
gh stack submit
71
76
```
72
77
73
78
Ready to dive in? Start with the [Quick Start guide](/gh-stack/getting-started/quick-start/) or read the [full overview](/gh-stack/introduction/overview/).
Push all branches in the current stack and create or update pull requests.
114
+
Push all branches in the current stack to the remote.
115
115
116
116
```sh
117
117
gh stack push [flags]
118
118
```
119
119
120
-
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.
120
+
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.
121
+
122
+
| Flag | Description |
123
+
|------|-------------|
124
+
|`--remote <name>`| Remote to push to (defaults to auto-detected remote) |
125
+
126
+
**Examples:**
127
+
128
+
```sh
129
+
gh stack push
130
+
gh stack push --remote upstream
131
+
```
132
+
133
+
---
134
+
135
+
## `gh stack submit`
136
+
137
+
Push all branches and create/update PRs and the stack on GitHub.
138
+
139
+
```sh
140
+
gh stack submit [flags]
141
+
```
142
+
143
+
Creates a Stacked PR for every branch in the stack, pushing branches to the remote. 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 are added to the existing stack.
121
144
122
145
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.
123
146
124
147
| Flag | Description |
125
148
|------|-------------|
126
149
|`--auto`| Use auto-generated PR titles without prompting |
127
150
|`--draft`| Create new PRs as drafts |
128
-
|`--skip-prs`| Push branches without creating or updating PRs |
129
151
|`--remote <name>`| Remote to push to (defaults to auto-detected remote) |
130
152
131
153
**Examples:**
132
154
133
155
```sh
134
-
gh stack push
135
-
gh stack push --auto
136
-
gh stack push --draft
137
-
gh stack push --skip-prs
156
+
gh stack submit
157
+
gh stack submit --auto
158
+
gh stack submit --draft
138
159
```
139
160
140
161
---
@@ -264,39 +285,6 @@ gh stack checkout
264
285
265
286
---
266
287
267
-
## `gh stack unstack`
268
-
269
-
Remove a stack from local tracking and optionally delete it on GitHub.
270
-
271
-
```sh
272
-
gh stack unstack [branch] [flags]
273
-
```
274
-
275
-
If no branch is specified, uses the current branch to find the stack. By default, the stack is removed from both local tracking and GitHub. Use `--local` to only remove the local tracking entry.
276
-
277
-
| Flag | Description |
278
-
|------|-------------|
279
-
|`--local`| Only delete the stack locally (keep it on GitHub) |
280
-
281
-
| Argument | Description |
282
-
|----------|-------------|
283
-
|`[branch]`| A branch in the stack to delete (defaults to the current branch) |
284
-
285
-
**Examples:**
286
-
287
-
```sh
288
-
# Remove the stack from local tracking and GitHub
289
-
gh stack unstack
290
-
291
-
# Only remove local tracking
292
-
gh stack unstack --local
293
-
294
-
# Specify a branch to identify the stack
295
-
gh stack unstack feature-auth
296
-
```
297
-
298
-
---
299
-
300
288
## Navigation
301
289
302
290
Move between branches in the current stack without having to remember branch names.
0 commit comments