Skip to content

Commit 1e7f19c

Browse files
committed
rebase after squash merge clarifications
1 parent 408eecf commit 1e7f19c

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

skills/gh-stack/SKILL.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -296,15 +296,15 @@ When a PR is squash-merged on GitHub, the original branch's commits no longer ex
296296
# After PR #1 (feat/auth) is squash-merged on GitHub:
297297
gh stack sync
298298
# → fetches latest, detects the merge, fast-forwards trunk
299-
# → rebases feat/api-routes onto updated trunk using --onto (skips merged branch)
300-
# → rebases feat/api-tests onto feat/api-routes
299+
# → rebases feat/api-routes onto updated trunk (skips merged branch)
300+
# → rebases feat/frontend onto feat/api-routes
301301
# → pushes updated branches
302302
# → reports: "Merged: #1"
303303

304304
# Verify the result
305305
gh stack view --json
306306
# → feat/auth shows "isMerged": true, "state": "MERGED"
307-
# → feat/api-routes and feat/api-tests show updated heads
307+
# → feat/api-routes and feat/frontend show updated heads
308308
```
309309

310310
If `sync` hits a conflict during this process, it restores all branches to their pre-rebase state and exits with code 3. See [Handle rebase conflicts](#handle-rebase-conflicts-agent-workflow) for the resolution workflow.
@@ -520,7 +520,7 @@ gh stack sync [flags]
520520

521521
1. **Fetch** latest changes from the remote
522522
2. **Fast-forward trunk** to match remote (skips if already up to date, warns if diverged)
523-
3. **Cascade rebase** all stack branches onto their updated parents (only if trunk moved). Handles squash-merged PRs automatically with `--onto`. If a conflict is detected, **all branches are restored** to their pre-rebase state and the command exits with code 3 — see [Handle rebase conflicts](#handle-rebase-conflicts-agent-workflow) for the resolution workflow
523+
3. **Cascade rebase** all stack branches onto their updated parents (only if trunk moved). Handles squash-merged PRs automatically. If a conflict is detected, **all branches are restored** to their pre-rebase state and the command exits with code 3 — see [Handle rebase conflicts](#handle-rebase-conflicts-agent-workflow) for the resolution workflow
524524
4. **Push** all active branches atomically
525525
5. **Sync PR state** from GitHub and report the status of each PR
526526

@@ -575,7 +575,7 @@ gh stack rebase --abort
575575

576576
**Conflict handling:** See [Handle rebase conflicts](#handle-rebase-conflicts-agent-workflow) in the Workflows section for the full resolution workflow.
577577

578-
**Squash-merge detection:** If a branch's PR was squash-merged on GitHub, the rebase automatically uses `git rebase --onto` to correctly replay commits on top of the merge target. This is handled transparently.
578+
**Squash-merge detection:** If a branch's PR was squash-merged on GitHub, the rebase automatically handles this and correctly replays commits on top of the merge target.
579579

580580
**Rerere (conflict memory):** `git rerere` is enabled by `init` so previously resolved conflicts are auto-resolved in future rebases.
581581

0 commit comments

Comments
 (0)