Skip to content

Commit 3c30dae

Browse files
committed
updates for latest cmd changes
1 parent c270888 commit 3c30dae

File tree

7 files changed

+63
-59
lines changed

7 files changed

+63
-59
lines changed

docs/src/content/docs/faq.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,26 +24,24 @@ gh stack add auth-layer
2424
# ... make commits ...
2525
gh stack add api-routes
2626
# ... make commits ...
27-
gh stack push
27+
gh stack submit
2828
```
2929

3030
Or you can create stacked PRs manually by setting each PR's base branch to the branch of the PR below it.
3131

3232
### How do I add PRs to my stack?
3333

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.
3535

3636
### How can I modify my stack?
3737

3838
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.
3939

4040
### How do I delete my stack?
4141

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 -->
4343

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.
4745

4846
### Can stacks be created across forks?
4947

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

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,17 +59,25 @@ git add .
5959
git commit -m "Add API routes"
6060
```
6161

62-
### 4. Push and create PRs
62+
### 4. Push branches
6363

64-
Push all branches and create pull requests in one command:
64+
Push all branches to the remote:
6565

6666
```sh
6767
gh stack push
6868
```
6969

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
7171

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.
79+
80+
### 6. View the stack
7381

7482
See the full state of your stack at any time:
7583

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,14 @@ When you merge a PR at the bottom of the stack, the remaining branches are **aut
8484
After making local changes or resolving conflicts, use the CLI to push and sync:
8585

8686
```sh
87-
# Push all branches and create/update PRs
87+
# Push all branches to the remote
8888
gh stack push
8989

90+
# Create or update PRs and the Stack on GitHub
91+
gh stack submit
92+
9093
# Or sync everything in one command (fetch, rebase, push, update PRs)
9194
gh stack sync
9295
```
9396

94-
`gh stack push` uses `--force-with-lease` by default to safely update rebased branches.
97+
`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.

docs/src/content/docs/guides/workflows.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ gh stack init
2020
gh stack add api-routes
2121
# ... write code, make commits ...
2222

23-
# 4. Push everything and create PRs
24-
gh stack push
23+
# 4. Push everything and create Stacked PRs
24+
gh stack submit
2525

2626
# 5. Reviewer requests changes on the first PR
2727
gh stack bottom
@@ -30,7 +30,7 @@ gh stack bottom
3030
# 6. Rebase the rest of the stack on top of your fix
3131
gh stack rebase
3232

33-
# 7. Push the updated stack
33+
# 7. Push the updated branches
3434
gh stack push
3535

3636
# 8. When the first PR is merged, sync the stack
@@ -65,8 +65,8 @@ gh stack add -Am "API routes"
6565
gh stack add -Am "Frontend components"
6666
# → creates feat/03
6767

68-
# 7. Push everything
69-
gh stack push
68+
# 7. Push everything and create PRs
69+
gh stack submit
7070
```
7171

7272
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:
175175
- Plan stack structure based on the work being done
176176
- Create branches and commit changes in the right layers
177177
- Navigate between branches to make mid-stack changes
178-
- Push and create PRs with proper base branches
178+
- Push branches and create stacked PRs
179179
- Rebase after making changes to lower layers

docs/src/content/docs/index.mdx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,12 @@ gh stack add auth-layer
6767
# ... make commits ...
6868
gh stack add api-routes
6969
# ... make commits ...
70+
71+
# Push all branches
7072
gh stack push
73+
74+
# Open a stack of PRs
75+
gh stack submit
7176
```
7277

7378
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/).

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ While the PR UI provides the review and merge experience, the `gh stack` CLI han
7676

7777
- **Creating branches**`gh stack init` and `gh stack add` create and track branches in the correct dependency order.
7878
- **Keeping branches rebased**`gh stack rebase` cascades changes through the stack, handling both regular and squash-merged PRs.
79-
- **Pushing and creating PRs**`gh stack push` pushes all branches and creates or updates PRs with the correct base branches.
79+
- **Pushing branches**`gh stack push` pushes all branches to the remote.
80+
- **Creating PRs**`gh stack submit` pushes branches and creates or updates PRs, linking them as a Stack on GitHub.
8081
- **Navigating the stack**`gh stack up`, `down`, `top`, and `bottom` let you move between layers without remembering branch names.
8182
- **Syncing everything**`gh stack sync` fetches, rebases, pushes, and updates PR state in one command.
8283

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

Lines changed: 29 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -111,30 +111,51 @@ gh stack add -um "Update docs" docs-layer
111111

112112
## `gh stack push`
113113

114-
Push all branches in the current stack and create or update pull requests.
114+
Push all branches in the current stack to the remote.
115115

116116
```sh
117117
gh stack push [flags]
118118
```
119119

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.
121144

122145
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.
123146

124147
| Flag | Description |
125148
|------|-------------|
126149
| `--auto` | Use auto-generated PR titles without prompting |
127150
| `--draft` | Create new PRs as drafts |
128-
| `--skip-prs` | Push branches without creating or updating PRs |
129151
| `--remote <name>` | Remote to push to (defaults to auto-detected remote) |
130152

131153
**Examples:**
132154

133155
```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
138159
```
139160

140161
---
@@ -264,39 +285,6 @@ gh stack checkout
264285

265286
---
266287

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-
300288
## Navigation
301289

302290
Move between branches in the current stack without having to remember branch names.
@@ -388,3 +376,4 @@ gh stack alias gst --remove
388376
| 5 | Invalid arguments or flags |
389377
| 6 | Disambiguation required (branch belongs to multiple stacks) |
390378
| 7 | Rebase already in progress |
379+
| 8 | Stack is locked by another process |

0 commit comments

Comments
 (0)