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
Expose --atomic for multi-ref pushes through the shared Git push
infrastructure. Keep push non-atomic by default and preserve sync's
existing atomic default with --atomic=false available as an opt-out.
Document the command behavior, audit link and submit push paths, and add
unit and integration coverage for atomic rejection semantics.
Copy file name to clipboardExpand all lines: docs/src/content/docs/reference/cli.md
+8-2Lines changed: 8 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -304,6 +304,7 @@ gh stack sync [flags]
304
304
305
305
| Flag | Description |
306
306
|------|-------------|
307
+
|`--atomic`| Require all branch updates to succeed or fail together (enabled by default; use `--atomic=false` to disable) |
307
308
|`--remote <name>`| Remote to fetch from and push to (defaults to auto-detected remote) |
308
309
|`--prune`| Delete local branches for merged PRs |
309
310
@@ -313,7 +314,7 @@ Performs a synchronization of the entire stack:
313
314
2.**Reconcile the remote stack** — mirrors the GitHub stack locally. When PRs have been added to the stack on GitHub (the remote is ahead of your local stack), their branches are pulled down and appended to your local stack automatically. When the local and remote stacks have genuinely diverged (for example, you added a branch locally while different PRs were added to the stack on GitHub), you are prompted to resolve (see **Diverged stacks** below). In a non-interactive terminal a divergence aborts the sync (nothing is pushed or updated).
314
315
3.**Fast-forward trunk** — fast-forwards the trunk branch to match the remote (skips if diverged).
315
316
4.**Cascade rebase** — rebases all stack branches onto their updated parents (only if trunk moved). If a conflict is detected, all branches are restored to their original state, and you are advised to run `gh stack rebase` to resolve conflicts interactively.
316
-
5.**Push** — pushes all branches (uses `--force-with-lease` if a rebase occurred).
317
+
5.**Push** — pushes all branches atomically by default (uses `--force-with-lease` if a rebase occurred). Use `--atomic=false` to allow branches whose updates succeed to proceed when another branch is rejected.
317
318
6.**Sync PRs** — syncs PR state from GitHub and reports the status of each PR.
318
319
7.**Sync the stack** — links the stack's open PRs into a stack on GitHub, creating the remote stack object if it doesn't exist yet or updating it if it's partially formed. This only happens when two or more PRs exist; sync never opens PRs (use `gh stack submit` for that).
319
320
8.**Prune** — in interactive terminals, prompts to delete local branches for merged PRs. Use `--prune` to prune automatically.
@@ -335,6 +336,9 @@ In a non-interactive terminal, a divergence aborts the sync (exit success) witho
335
336
```sh
336
337
gh stack sync
337
338
339
+
# Explicitly allow partial branch updates
340
+
gh stack sync --atomic=false
341
+
338
342
# Sync and automatically prune merged branches
339
343
gh stack sync --prune
340
344
```
@@ -402,14 +406,16 @@ gh stack push [flags]
402
406
403
407
| Flag | Description |
404
408
|------|-------------|
409
+
|`--atomic`| Require all branch updates to succeed or fail together (disabled by default) |
405
410
|`--remote <name>`| Remote to push to (defaults to auto-detected remote) |
406
411
407
-
Pushes every active branch (excluding merged and queued branches) in one `git push` using explicit per-branch `--force-with-lease` checks. The update is not atomic: branches whose leases pass may update even if another branch is rejected. Fix the rejected branch and rerun the command; branches already updated will be unchanged. This command does not create or update pull requests — use `gh stack submit` for that.
412
+
Pushes every active branch (excluding merged and queued branches) in one `git push` using explicit per-branch `--force-with-lease` checks. By default, the update is not atomic: branches whose leases pass may update even if another branch is rejected. Use `--atomic` to make the multi-ref push all-or-nothing. This command does not create or update pull requests — use `gh stack submit` for that.
0 commit comments