[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-github-gh-stack":3,"mdc-tyynd6-key":36,"related-org-github-gh-stack":9479,"related-repo-github-gh-stack":9659},{"slug":4,"name":4,"fn":5,"description":6,"org":7,"tags":11,"stars":23,"repoUrl":24,"updatedAt":25,"license":26,"forks":27,"topics":28,"repo":31,"sourceUrl":34,"mdContent":35},"gh-stack","manage stacked GitHub PRs","Manage stacked branches and pull requests with the gh-stack GitHub CLI extension. Use when the user wants to create, push, rebase, sync, navigate, or view stacks of dependent PRs. Triggers on tasks involving stacked diffs, dependent pull requests, branch chains, or incremental code review workflows.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},"github","GitHub","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Fgithub.png",[12,14,17,20],{"name":9,"slug":8,"type":13},"tag",{"name":15,"slug":16,"type":13},"CLI","cli",{"name":18,"slug":19,"type":13},"Git","git",{"name":21,"slug":22,"type":13},"Pull Requests","pull-requests",507,"https:\u002F\u002Fgithub.com\u002Fgithub\u002Fgh-stack","2026-07-31T05:57:14.082065",null,17,[16,29,8,30],"gh-extension","stacked-prs",{"repoUrl":24,"stars":23,"forks":27,"topics":32,"description":33},[16,29,8,30],"GitHub Stacked PRs","https:\u002F\u002Fgithub.com\u002Fgithub\u002Fgh-stack\u002Ftree\u002FHEAD\u002Fskills\u002Fgh-stack","---\nname: gh-stack\ndescription: >\n  Manage stacked branches and pull requests with the gh-stack GitHub CLI extension.\n  Use when the user wants to create, push, rebase, sync, navigate, or view stacks of\n  dependent PRs. Triggers on tasks involving stacked diffs, dependent pull requests,\n  branch chains, or incremental code review workflows.\nmetadata:\n  author: github\n  version: \"0.0.9\"\n---\n\n# gh-stack\n\n`gh stack` is a [GitHub CLI](https:\u002F\u002Fcli.github.com\u002F) extension for managing **stacked branches and pull requests**. A stack is an ordered list of branches where each branch builds on the one below it, rooted on a trunk branch (typically the repo's default branch). Each branch maps to one PR whose base is the branch below it, so reviewers see only the diff for that layer.\n\n```\nmain (trunk)\n └── auth-layer     → PR #1 (base: main)            - bottom (closest to trunk)\n  └── api-endpoints → PR #2 (base: auth-layer)\n   └── frontend     → PR #3 (base: api-endpoints)   - top (furthest from trunk)\n```\n\nThe **bottom** of the stack is the branch closest to the trunk, and the **top** is the branch furthest from the trunk. Each branch inherits from the one below it. Navigation commands (`up`, `down`, `top`, `bottom`) follow this model: `up` moves away from trunk, `down` moves toward it.\n\n## When to use this skill\n\nUse this skill when the user wants to:\n\n- Break a large change into a chain of small, reviewable PRs\n- Create, rebase, push, or sync a stack of dependent branches\n- Navigate between layers of a branch stack\n- View the status of stacked PRs\n- Tear down and rebuild a stack to remove, reorder, or rename branches\n\n## Prerequisites\n\nThe GitHub CLI (`gh`) v2.0+ must be installed and authenticated. Install the extension with:\n\n```bash\ngh extension install github\u002Fgh-stack\n```\n\nBefore using `gh stack`, configure git to prevent interactive prompts:\n\n```bash\ngit config rerere.enabled true           # remember conflict resolutions (skips prompt on init)\ngit config remote.pushDefault origin     # if multiple remotes exist (skips remote picker)\n```\n\n## Agent rules\n\n**All `gh stack` commands must be run non-interactively.** Every command invocation must include the flags and positional arguments needed to avoid prompts, TUIs, and interactive menus. If a command would prompt for input, it will hang indefinitely.\n\n1. **Always supply branch names as positional arguments** to `init`, `add`, and `checkout`. Running these commands without arguments triggers interactive prompts. Branch names are used exactly as given — a name is never prefixed or transformed, so `gh stack add refactor\u002Ffoo` creates a branch named `refactor\u002Ffoo`.\n2. **Always use `--auto` with `gh stack submit`** to auto-generate PR titles. Without `--auto`, `submit` prompts for a title for each new PR.\n3. **Always use `--json` with `gh stack view`.** Without `--json`, the command launches an interactive TUI that cannot be operated by agents. There is no other appropriate flag — always pass `--json`.\n4. **Handle multiple remotes.** If more than one remote is configured, pre-configure `git config remote.pushDefault origin`, or pass `--remote \u003Cname>` to the commands that accept it: `push`, `submit`, `sync`, `rebase`, and `link`. `checkout`, `modify`, and `trunk` resolve a remote but have **no `--remote` flag** — they rely on `remote.pushDefault`. With multiple remotes and no configured default, these commands exit with an error in non-interactive mode.\n5. **Avoid branches shared across multiple stacks.** If a branch belongs to multiple stacks, commands exit with code 6. Check out a non-shared branch first.\n6. **Plan your stack layers by dependency order before writing code.** Foundational changes (models, APIs, shared utilities) go in lower branches; dependent changes (UI, consumers) go in higher branches. Think through the dependency chain before running `gh stack init`.\n7. **Use standard `git add` and `git commit` for staging and committing.** This gives you full control over which changes go into each branch. The `-Am` shortcut is available but should not be the default approach—stacked PRs are most effective when each branch contains a deliberate, logical set of changes.\n8. **Navigate down the stack when you need to change a lower layer.** If you're working on a frontend branch and realize you need API changes, don't hack around it at the current layer. Navigate to the appropriate branch (`gh stack down`, `gh stack checkout`, or `gh stack bottom`), make and commit the changes there, run `gh stack rebase --upstack`, then navigate back up to continue.\n9. **Use `gh stack link` for external tool workflows.** When branches are managed by an external tool (jj, Sapling, etc.), use `gh stack link branch-a branch-b`. `link` does not rely on local tracking state and is intended for API-driven PR and stack management. Provide at least two branches\u002FPRs to create or update a stack, or a stack number followed by the new branches\u002FPRs to append them to the top of an existing stack (e.g. `gh stack link 7 branch-c`).\n10. **Use `gh stack merge --yes` to merge stacked PRs.** `gh pr merge` does not work with stacked PRs. In a non-interactive terminal `gh stack merge` runs without prompting and merges the entire stack (bottom to top) atomically; pass `--yes` to be explicit. Scope the merge by passing a pull request number (`gh stack merge 42 --yes` merges everything up to and including PR #42) or a stack number (`gh stack merge 7 --yes`, which needs no local checkout). Choose the method with `--squash`, `--rebase`, `--merge`, or `--merge-method \u003Cmethod>`; without one, the last-used method is used. The merge is all-or-nothing — if any PR can't be merged, none are, and the failure reason is reported. Only basic pull request state is checked before merging (open and not a draft); bypassing merge requirements is not supported for stacks. If the base branch uses a merge queue, the stack is added to the queue instead of merging directly: the queue chooses the merge method (any method you pass is ignored with a warning), and the pull requests are added to the queue together but merge as the queue processes them, so they may land in separate groups rather than all at once.\n\n**Never do any of the following — each triggers an interactive prompt or TUI that will hang:**\n- ❌ `gh stack view` or `gh stack view --short` — always use `gh stack view --json`\n- ❌ `gh stack submit` without `--auto` — always use `gh stack submit --auto`\n- ❌ `gh stack init` without branch arguments — always provide branch names\n- ❌ `gh stack add` without a branch name — always provide a branch name\n- ❌ `gh stack checkout` without an argument — always provide a PR number or branch name\n- ❌ `gh stack checkout \u003Cpr-number>` when a different local stack already exists on those branches — this triggers an unbypassable conflict resolution prompt; use `gh stack unstack --local` first to remove the local tracking state (this keeps the stack on GitHub intact), then retry the checkout\n\n## Thinking about stack structure\n\nEach branch in a stack should represent a **discrete, logical unit of work** that can be reviewed independently. The changes within a branch should be cohesive—they belong together and make sense as a single PR.\n\n### Dependency chain\n\nStacked branches form a dependency chain: each branch builds on the one below it. This means **foundational changes must go in lower (earlier) branches**, and code that depends on them goes in higher (later) branches.\n\n**Plan your layers before writing code.** For example, a full-stack feature might be structured like this (use branch names relevant to your actual task, not these generic ones):\n\n```\nmain (trunk)\n └── data-models    ← shared types, database schema\n  └── api-endpoints ← API routes that use the models\n   └── frontend-ui  ← UI components that call the APIs\n    └── integration ← tests that exercise the full stack\n```\n\nThis is illustrative — choose branch names and layer boundaries that reflect the specific work you're doing. The key principle is: if code in one layer depends on code in another, the dependency must be in the same branch or a lower one.\n\n### Branch naming\n\nChoose a clear, descriptive branch name for each layer that reflects the concern it contains (e.g., `auth`, `api-routes`, `frontend`). Branch names are used exactly as you provide them to `init` and `add` — nothing is prepended or transformed. Slashes are allowed and are treated as part of the name (e.g., `gh stack add refactor\u002Ffoo` creates a branch named `refactor\u002Ffoo`).\n\n### Staging changes deliberately\n\nThe main reason to use `git add` and `git commit` directly is to control **which changes go into which branch**. When you have multiple files in your working tree, you can stage a subset for the current branch, commit them, then create a new branch and stage the rest there:\n\n```bash\n# You're on data-models with several new files in your working tree.\n# Stage only the model files for this branch:\ngit add internal\u002Fmodels\u002Fuser.go internal\u002Fmodels\u002Fsession.go\ngit commit -m \"Add user and session models\"\n\ngit add db\u002Fmigrations\u002F001_create_users.sql\ngit commit -m \"Add user table migration\"\n\n# Now create a new branch for the API layer and stage the API files there:\ngh stack add api-routes # created & switched to the api-routes branch\ngit add internal\u002Fapi\u002Froutes.go internal\u002Fapi\u002Fhandlers.go\ngit commit -m \"Add user API routes\"\n```\n\nThis keeps each branch focused on one concern. Multiple commits per branch are fine — the key is that all commits in a branch relate to the same logical concern, and changes that belong to a different concern go in a different branch.\n\n### When to create a new branch\n\nCreate a new branch (`gh stack add`) when you're starting a **different concern** that depends on what you've built so far. Signs it's time for a new branch:\n\n- You're switching from backend to frontend work\n- You're moving from core logic to tests or documentation\n- The next set of changes has a different reviewer audience\n- The current branch's PR is already large enough to review\n\n### One stack, one story\n\nThink of a stack from the reviewer's perspective: the stack of PRs should **tell a cohesive story** about a feature or project. A reviewer should be able to read the PRs in sequence and understand the progression of changes, with each PR being a small, logical piece of the whole.\n\n**When to use a single stack:** All the branches are part of the same feature, project, or closely related effort. Even if the work spans multiple concerns (models, API, frontend), they're all building toward the same goal.\n\n**When to create a separate stack:** The work is unrelated to your current stack — a different feature, a bug fix in an unrelated area, or an independent refactor. Don't mix unrelated work into a single stack just because you happen to be working on both. Start a new stack with `gh stack init` or switch to an existing stack with `gh stack checkout` for each distinct effort.\n\nSmall, incidental fixes (e.g., fixing a typo you noticed) can go in the current stack if they're trivial. But if a change grows into its own project, it deserves its own stack.\n\n## Quick reference\n\n| Task | Command |\n|------|---------|\n| Create a stack | `gh stack init auth` |\n| Create a stack of multiple branches | `gh stack init auth api frontend` |\n| Adopt existing branches | `gh stack init existing-branch-a existing-branch-b` |\n| Set custom trunk | `gh stack init --base develop branch-a` |\n| Add a branch to stack | `gh stack add api-routes` |\n| Add branch + stage all + commit | `gh stack add -Am \"message\" api-routes` |\n| Push branches to remote | `gh stack push` |\n| Push to specific remote | `gh stack push --remote origin` |\n| Push branches + create draft PRs | `gh stack submit --auto` |\n| Create PRs as ready for review | `gh stack submit --auto --open` |\n| Sync (fetch, rebase, push) | `gh stack sync` |\n| Sync with specific remote | `gh stack sync --remote origin` |\n| Sync and prune merged branches | `gh stack sync --prune` |\n| Rebase entire stack | `gh stack rebase` |\n| Rebase upstack only | `gh stack rebase --upstack` |\n| Rebase without trunk | `gh stack rebase --no-trunk` |\n| Continue after conflict | `gh stack rebase --continue` |\n| Abort rebase | `gh stack rebase --abort` |\n| View stack details (JSON) | `gh stack view --json` |\n| Switch branches up\u002Fdown in stack | `gh stack up [n]` \u002F `gh stack down [n]` |\n| Switch to top\u002Fbottom branch | `gh stack top` \u002F `gh stack bottom` |\n| Check out by stack number | `gh stack checkout 7` |\n| Check out by PR | `gh stack checkout 42` |\n| Check out by branch (local only) | `gh stack checkout feature-auth` |\n| Tear down the current stack to restructure it | `gh stack unstack` |\n| Tear down a specific stack by number | `gh stack unstack 7` |\n| Merge the whole current stack | `gh stack merge --yes` |\n| Merge a stack by number | `gh stack merge 7 --yes` |\n| Merge up to a specific PR | `gh stack merge 42 --yes` |\n| Merge with a specific method | `gh stack merge --yes --squash` |\n\n---\n\n## Workflows\n\n### End-to-end: create a stack from scratch\n\n```bash\n# 1. Initialize a stack with the first branch\ngh stack init auth\n# → creates auth and checks it out\n\n# 2. Write code for the first layer (auth)\ncat > auth.go \u003C\u003C 'EOF'\npackage auth\n\nfunc Middleware(next http.Handler) http.Handler {\n    return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n        \u002F\u002F verify token\n        next.ServeHTTP(w, r)\n    })\n}\nEOF\n\n# 3. Stage and commit using standard git commands\ngit add auth.go\ngit commit -m \"Add auth middleware\"\n\n# You can make multiple commits on the same branch\ncat > auth_test.go \u003C\u003C 'EOF'\npackage auth\n\nfunc TestMiddleware(t *testing.T) {\n    \u002F\u002F test auth middleware\n}\nEOF\ngit add auth_test.go\ngit commit -m \"Add auth middleware tests\"\n\n# 4. When you're ready for a new concern, add the next branch\ngh stack add api-routes\n# → creates api-routes\n\n# 5. Write code for the API layer\ncat > api.go \u003C\u003C 'EOF'\npackage api\n\nfunc RegisterRoutes(mux *http.ServeMux) {\n    mux.HandleFunc(\"\u002Fusers\", handleUsers)\n}\nEOF\ngit add api.go\ngit commit -m \"Add API routes\"\n\n# 6. Add a third layer for frontend\ngh stack add frontend\n# → creates frontend\n\ncat > frontend.go \u003C\u003C 'EOF'\npackage frontend\n\nfunc RenderDashboard(w http.ResponseWriter) {\n    \u002F\u002F calls the API endpoints from the layer below\n}\nEOF\ngit add frontend.go\ngit commit -m \"Add frontend dashboard\"\n\n# ── Stack complete: auth → api-routes → frontend ──\n\n# 7. Push everything and create PRs (drafts by default)\ngh stack submit --auto\n\n# 8. Verify the stack\ngh stack view --json\n```\n\n> **Shortcut:** If you prefer a faster flow, `gh stack add -Am \"message\" branch-name` combines staging, committing, and branch creation into one command. This is useful for single-commit layers but bypasses deliberate staging.\n\n### Making mid-stack changes\n\nThis is a critical workflow for agents. When you're working on a higher layer and realize you need to change something in a lower layer (e.g., you're building frontend components but need to add an API endpoint), **navigate down to the correct branch, make the change there, and rebase**.\n\n```bash\n# You're on frontend but need to add an API endpoint\n\n# 1. Navigate to the API branch\ngh stack down\n# or: gh stack checkout api-routes\n\n# 2. Make the change where it belongs\ncat > users_api.go \u003C\u003C 'EOF'\npackage api\n\nfunc handleGetUser(w http.ResponseWriter, r *http.Request) {\n    \u002F\u002F new endpoint the frontend needs\n}\nEOF\ngit add users_api.go\ngit commit -m \"Add get-user endpoint\"\n\n# 3. Rebase everything above to pick up the change\ngh stack rebase --upstack\n\n# 4. Navigate back to where you were working\ngh stack top\n# or: gh stack checkout frontend\n\n# 5. Continue working — the API changes are now available\n```\n\n**Why this matters:** If you make API changes on the frontend branch, those changes will end up in the wrong PR. The API PR won't include them, and the frontend PR will have unrelated API diffs mixed in. Always put changes in the branch where they logically belong.\n\n### Modify a mid-stack branch and sync\n\nWhen you need to revisit a branch after the initial creation (e.g., responding to review feedback):\n\n```bash\n# 1. Navigate to the branch that needs changes\ngh stack bottom\n# or: gh stack checkout auth\n# or: gh stack checkout 42  (by PR number)\n\n# 2. Make changes and commit\ncat > auth.go \u003C\u003C 'EOF'\npackage auth\n\u002F\u002F updated implementation\nEOF\ngit add auth.go\ngit commit -m \"Fix auth token validation\"\n\n# 3. Rebase everything above this branch\ngh stack rebase --upstack\n\n# 4. Push the updated stack\ngh stack push\n```\n\n### Routine sync after merges\n\n```bash\n# Single command: fetch, rebase, push, sync PR and stack state\ngh stack sync\n\n# Sync and automatically clean up local branches for merged PRs\ngh stack sync --prune\n```\n\n> **Note for agents:** In non-interactive environments, the prune prompt is not shown. Use `--prune` explicitly to delete local branches for merged PRs.\n\n> **Note for agents:** `sync` also mirrors the stack on GitHub locally. If PRs were added to the stack on github.com, their branches are pulled down and appended to the local stack automatically. If the local and remote stacks have **diverged** (you changed the local stack while the remote stack changed differently), sync can only prompt to resolve it in an interactive terminal — in non-interactive environments it aborts the sync (nothing is pushed or updated) and exits successfully with `ℹ Sync aborted`. Resolve a divergence by unstacking and recreating the stack.\n\n### Squash-merge recovery\n\nWhen a PR is squash-merged on GitHub, the original branch's commits no longer exist in the trunk history. `gh stack` detects this automatically and uses `git rebase --onto` to correctly replay remaining commits.\n\n```bash\n# After PR #1 (auth) is squash-merged on GitHub:\ngh stack sync\n# → fetches latest, detects the merge, fast-forwards trunk\n# → rebases api-routes onto updated trunk (skips merged branch)\n# → rebases frontend onto api-routes\n# → pushes updated branches\n# → reports: \"Merged: #1\"\n\n# Verify the result\ngh stack view --json\n# → auth shows \"isMerged\": true, \"state\": \"MERGED\"\n# → api-routes and frontend show updated heads\n```\n\nIf `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.\n\n### Handle rebase conflicts (agent workflow)\n\n```bash\n# 1. Start the rebase\ngh stack rebase\n\n# 2. If exit code 3 (conflict):\n#    - Parse stderr for conflicted file paths\n#    - Read those files to find \u003C\u003C\u003C\u003C\u003C\u003C\u003C \u002F ======= \u002F >>>>>>> markers\n#    - Edit files to resolve conflicts\n#    - Stage resolved files:\ngit add path\u002Fto\u002Fresolved-file.go\n\n# 3. Continue the rebase\ngh stack rebase --continue\n\n# 4. If another conflict occurs, repeat steps 2-3\n\n# 5. If unable to resolve, abort to restore everything\ngh stack rebase --abort\n```\n\n### Parsing `--json` output\n\n```bash\n# Get stack state as JSON\noutput=$(gh stack view --json)\n\n# Check if any branch needs a rebase, and rebase if so\nneeds_rebase=$(echo \"$output\" | jq '[.branches[] | select(.needsRebase == true)] | length')\nif [ \"$needs_rebase\" -gt 0 ]; then\n  echo \"Branches need rebase, rebasing stack...\"\n  gh stack rebase\nfi\n\n# Get all open PR URLs\necho \"$output\" | jq -r '.branches[] | select(.pr.state == \"OPEN\") | .pr.url'\n\n# Find merged branches\necho \"$output\" | jq -r '.branches[] | select(.isMerged == true) | .name'\n\n# Get the current branch\necho \"$output\" | jq -r '.currentBranch'\n\n# Check if the stack is fully merged (all branches merged)\necho \"$output\" | jq '[.branches[] | .isMerged] | all'\n```\n\n### Restructure a stack (remove a branch, reorder, or rename)\n\nUse `unstack` to tear down the stack, make structural changes, then re-init:\n\n```bash\n# 1. Remove the local tracking and the GitHub stack grouping (PRs are NOT deleted)\ngh stack unstack\n\n# 2. Make structural changes — e.g. delete a branch, reorder, rename\ngit branch -m old-branch-1 new-branch-1\n\n# 3. Re-create the stack with the new structure\ngh stack init --base main new-branch-1 new-branch-2 new-branch-3\n```\n\n---\n\n## Commands\n\n### Initialize a stack — `gh stack init`\n\nCreates a new stack. **Always provide at least one branch name as a positional argument** — running without branch arguments triggers interactive prompts that agents cannot use.\n\n```\ngh stack init [flags] \u003Cbranches...>\n```\n\n```bash\n# Create a stack with a new branch\ngh stack init auth\n# → creates auth and checks it out\n\n# Create a stack with new branches\ngh stack init branch-a branch-b branch-c\n\n# Use a different trunk branch\ngh stack init --base develop branch-a branch-b\n\n# Adopt existing branches into a stack (handled automatically if the branches exist)\ngh stack init branch-a branch-b branch-c\n```\n\n| Flag | Description |\n|------|-------------|\n| `-b, --base \u003Cbranch>` | Trunk branch (defaults to the repo's default branch) |\n\n**Behavior:**\n\n- Branch names are created exactly as given (slashes are allowed and kept as-is)\n- Creates any branches that don't already exist (branching from the trunk branch)\n- Existing branches are adopted automatically; missing branches are created from the trunk\n- Checks out the last branch in the list\n- Enables `git rerere` so conflict resolutions are remembered across rebases. On first run in a repo, this may trigger a confirmation prompt — pre-configure with `git config rerere.enabled true` to avoid it\n\n---\n\n### Add a branch — `gh stack add`\n\nAdd a new branch on top of the current stack. Must be run while on the topmost branch (or the trunk if the stack has no branches yet). **Always provide a branch name** — running without one triggers an interactive prompt.\n\n```\ngh stack add [flags] \u003Cbranch>\n```\n\n**Recommended workflow — create the branch, then use standard git:**\n\n```bash\n# Create a new branch and switch to it\ngh stack add api-routes\n\n# Write code, stage deliberately, and commit\ngit add internal\u002Fapi\u002Froutes.go internal\u002Fapi\u002Fhandlers.go\ngit commit -m \"Add user API routes\"\n\n# Make more commits on the same branch as needed\ngit add internal\u002Fapi\u002Fmiddleware.go\ngit commit -m \"Add rate limiting middleware\"\n```\n\n**Shortcut — stage, commit, and branch in one command:**\n\n```bash\n# Create a new branch, stage all changes, and commit\ngh stack add -Am \"Add API routes\" api-routes\n\n# Create a new branch, stage tracked files only, and commit\ngh stack add -um \"Fix auth bug\" auth-fix\n```\n\n| Flag | Description |\n|------|-------------|\n| `-m, --message \u003Cstring>` | Create a commit with this message |\n| `-A, --all` | Stage all changes including untracked files (requires `-m`) |\n| `-u, --update` | Stage tracked files only (requires `-m`) |\n\n**Behavior notes:**\n\n- `-A` and `-u` are mutually exclusive.\n- When the current branch has no commits (e.g., right after `init`), `add -Am` commits directly on the current branch instead of creating a new one.\n- **Branch names are used verbatim.** `gh stack add refactor\u002Ffoo` creates a branch named `refactor\u002Ffoo` — names are never prefixed or transformed. When `-m` is given without a branch name, the name is auto-generated from the commit message in date+slug format (e.g., `03-24-add_api_routes`).\n- If called from a branch that is not the topmost in the stack, exits with code 5: `\"can only add branches on top of the stack\"`. Use `gh stack top` to switch first.\n- **Uncommitted changes:** When using `gh stack add branch-name` without `-Am`, any uncommitted changes (staged or unstaged) in your working tree carry over to the new branch. This is standard git behavior — the working tree is not touched. Commit or stash changes on the current branch before running `add` if you want a clean starting point on the new branch.\n\n---\n\n### Push branches to remote — `gh stack push`\n\nPush active stack branches to the remote.\n\n```\ngh stack push [flags]\n```\n\n```bash\n# Push all branches\ngh stack push\n\n# Push to specific remote\ngh stack push --remote upstream\n```\n\n| Flag | Description |\n|------|-------------|\n| `--remote \u003Cname>` | Remote to push to (use if multiple remotes exist) |\n\n**Behavior:**\n\n- Pushes all active (non-merged, non-queued) branches in one non-atomic multi-ref push with explicit per-branch `--force-with-lease` checks\n- Some branches may update if another is rejected; fix the rejected branch and rerun the command\n- Does **not** create or update pull requests — use `gh stack submit` for that\n\n**Output (stderr):**\n\n- `Pushed N branches` summary\n\n---\n\n### Submit branches and create PRs — `gh stack submit`\n\nPush all stack branches and create PRs on GitHub. **Always pass `--auto`** — without it, `submit` prompts for a PR title for each new branch.\n\n```bash\n# Submit and auto-title new PRs (required for non-interactive use)\ngh stack submit --auto\n\n# Submit and create PRs as ready for review (not drafts)\ngh stack submit --auto --open\n```\n\n| Flag | Description |\n|------|-------------|\n| `--auto` | Auto-generate PR titles without prompting (**required** for non-interactive use) |\n| `--open` | Mark new and existing PRs as ready for review |\n| `--remote \u003Cname>` | Remote to push to (use if multiple remotes exist) |\n\n**Behavior:**\n\n- Pushes each active (non-merged, non-queued) branch sequentially with explicit per-branch `--force-with-lease` checks; the overall submit is not atomic\n- If a later branch push is rejected, earlier branch pushes and PR updates remain; fix the rejection and rerun the same command\n- Creates a new PR for each branch that doesn't have one (base set to the first non-merged ancestor branch)\n- After creating PRs, links them together as a **Stack** on GitHub (requires the repository to have stacks enabled)\n- If every PR in the stack has already been merged, the stack is complete and can't be extended. `submit` automatically forks your unmerged branches into a **new** stack rooted at the trunk and creates it on GitHub, leaving the merged stack untouched.\n- If stacks are not available (exit code 9), the repository does not have stacked PRs enabled. In interactive mode, `submit` offers to create regular (unstacked) PRs instead. In non-interactive mode, it exits with code 9.\n- Syncs PR metadata for branches that already have PRs\n\n**PR title auto-generation (`--auto`):**\n\n- Single commit on branch → uses the commit subject as the PR title, commit body as PR body\n- Multiple commits on branch → humanizes the branch name (hyphens\u002Funderscores → spaces) as the title\n\n**Output (stderr):**\n\n- `Created PR #N for \u003Cbranch>` for each newly created PR\n- `PR #N for \u003Cbranch> is up to date` for existing PRs\n- `Pushed and synced N branches` summary\n\n---\n\n### Link branches as a stack (no local tracking) — `gh stack link`\n\nLink PRs into a stack on GitHub without creating any local tracking state. This is the recommended approach if you are managing stacked branches with other tools (jj, Sapling, git-town) and want to simply create GitHub Stacked PRs via an API.\n\n```\ngh stack link [flags] \u003Cstack-number | branch-or-pr> \u003Cbranch-or-pr> [...]\n```\n\n```bash\n# Link branches into a stack (pushes, creates PRs, creates stack)\ngh stack link branch-a branch-b branch-c\n\n# Use a different base branch and mark PRs as ready for review\ngh stack link --base develop --open branch-a branch-b branch-c\n\n# Link existing PRs by number\ngh stack link 10 20 30\n\n# Add branches to an existing stack of PRs\ngh stack link 42 43 feature-auth feature-ui\n\n# Append to the top of an existing stack by its stack number\n# (7 is a stack number; only the new PRs\u002Fbranches are listed)\ngh stack link 7 48 feature-auth\n```\n\nWhen the first argument is a stack number, the remaining arguments are appended to the top of that stack, so you don't have to re-list its current PRs. Arguments already in the stack are skipped; arguments in a different stack are rejected. A numeric first argument is treated as a stack only when it matches an existing stack — otherwise it is a PR or branch.\n\n| Flag | Description |\n|------|---------|\n| `--base \u003Cbranch>` | Base branch for the bottom of the stack (defaults to the repository's default branch) |\n| `--open` | Mark new and existing PRs as ready for review |\n| `--remote \u003Cname>` | Remote to push to (use if multiple remotes exist) |\n\n**Behavior:**\n\n- Arguments are provided in stack order (bottom to top)\n- Each argument can be a branch name or a PR number. Numeric arguments are tried as PR numbers first; if no PR with that number exists, the argument is treated as a branch name\n- Branch arguments are pushed to the remote automatically (non-force, atomic)\n- For branches without open PRs, new PRs are created with auto-generated titles and the correct base branch chaining (first branch uses `--base`, subsequent branches use the previous branch)\n- Existing PRs whose base branch doesn't match the expected chain are corrected automatically\n- If the PRs are not yet in a stack, a new stack is created. If some PRs are already in a stack, the stack is updated (additive only — existing PRs are never removed)\n- Does **not** create or modify any local state\n\n**Output (stderr):**\n\n- `Pushing N branches to \u003Cremote>...`\n- `Found PR #N for branch \u003Cname>` for branches with existing PRs\n- `Created PR #N for \u003Cbranch> (base: \u003Cbase>)` for newly created PRs\n- `Updated base branch for PR #N to \u003Cbase>` when base branches are corrected\n- `Created stack with N PRs` or `Updated stack to N PRs`\n\n---\n\n### Sync the stack — `gh stack sync`\n\nFetch, rebase, push, and sync PR state in a single command. This is the recommended command for routine synchronization.\n\n```\ngh stack sync [flags]\n```\n\n| Flag | Description |\n|------|-------------|\n| `--remote \u003Cname>` | Remote to fetch from and push to (use if multiple remotes exist) |\n| `--prune` | Delete local branches for merged PRs |\n\n**What it does (in order):**\n\n1. **Fetch** latest changes from the remote\n2. **Reconcile the remote stack** — mirror the GitHub stack locally. If PRs were added to the stack on GitHub, pull their branches down and append them to the local stack. If the local and remote stacks have diverged, aborts the sync in a non-interactive terminal. In an interactive terminal, offers prompts to resolve any divergence (replace local stack with remote version, delete stack on GitHub so it can be recreated, or cancel).\n3. **Fast-forward trunk** to match remote (skips if already up to date, warns if diverged)\n4. **Cascade rebase** all stack branches onto their updated parents (only if trunk moved). Handles 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\n5. **Push** all active branches atomically\n6. **Sync PR state** from GitHub and report the status of each PR\n7. **Sync the stack object** — link the open PRs into a stack on GitHub. If the PRs are not yet in a stack, a new stack is created; if some PRs are already in a stack, it is updated (additive only). This only happens when two or more PRs exist. Sync **never opens PRs** — use `gh stack submit` for that\n8. **Prune** — in interactive terminals, prompts to delete local branches for merged PRs. Use `--prune` to skip the prompt. In non-interactive environments, pruning only happens when `--prune` is passed explicitly\n\n**Output (stderr):**\n\n- `✓ Fetched latest changes from origin`\n- `Pulling N new branches from the remote stack ...` then `✓ Pulled N new branches into the stack from the remote` (when the remote stack is ahead)\n- `⚠ Your local stack has diverged from the stack on GitHub` (with `Local:` \u002F `Remote:` chains) when the stacks have diverged\n- `ℹ Sync aborted — no changes were made` when a sync is cancelled\n- `✓ Trunk main fast-forwarded to \u003Csha>` or `✓ Trunk main is already up to date`\n- `✓ Rebased \u003Cbranch> onto \u003Cbase>` per branch (if base moved)\n- `✓ Pushed N branches`\n- `✓ PR #N (\u003Cbranch>) — Open` per branch\n- `Merged: #N, #M` for merged branches\n- `✓ Stack created on GitHub with N PRs` \u002F `✓ Stack updated on GitHub with N PRs` \u002F `✓ Linked to the existing stack on GitHub` (when two or more PRs exist)\n- `✓ Pruned \u003Cbranch> (merged)` per pruned branch (when pruning)\n- `✓ Stack synced` when the stack object on GitHub was created\u002Fupdated to match local, or `✓ Branches synced` when only the branches were synced (fewer than two PRs or stacked PRs unavailable)\n\n---\n\n### Rebase the stack — `gh stack rebase`\n\nPull from remote and cascade-rebase stack branches. Use this when `sync` reports a conflict or when you need finer control (e.g., rebase only part of the stack).\n\n```\ngh stack rebase [flags] [branch]\n```\n\n```bash\n# Rebase the entire stack\ngh stack rebase\n\n# Rebase only branches from trunk to current branch\ngh stack rebase --downstack\n\n# Rebase only branches from current branch to top\ngh stack rebase --upstack\n\n# Rebase stack branches without pulling from or rebasing with trunk\ngh stack rebase --no-trunk\n\n# After resolving a conflict: stage files with `git add`, then:\ngh stack rebase --continue\n\n# Abort and restore all branches to pre-rebase state\ngh stack rebase --abort\n```\n\n| Flag | Description |\n|------|-------------|\n| `--downstack` | Only rebase branches from trunk to the current branch |\n| `--upstack` | Only rebase branches from the current branch to the top |\n| `--no-trunk` | Skip trunk — only rebase stack branches onto each other (no fetch, no trunk rebase) |\n| `--continue` | Continue after resolving conflicts |\n| `--abort` | Abort and restore all branches |\n| `--remote \u003Cname>` | Remote to fetch from (use if multiple remotes exist) |\n\n| Argument | Description |\n|----------|-------------|\n| `[branch]` | Target branch (defaults to the current branch) |\n\n**Conflict handling:** See [Handle rebase conflicts](#handle-rebase-conflicts-agent-workflow) in the Workflows section for the full resolution workflow.\n\n**Merged PR detection:** If a branch's PR was merged on GitHub, the rebase automatically handles this using `--onto` mode and correctly replays commits on top of the merge target.\n\n**Rerere (conflict memory):** `git rerere` is enabled by `init` so previously resolved conflicts are auto-resolved in future rebases.\n\n**No-trunk mode:** Use `--no-trunk` to skip fetching from the remote and rebasing with the trunk branch. Only inter-branch rebases are performed (branch 2 onto branch 1, branch 3 onto branch 2, etc.). Useful when you only need to align stack branches with each other without pulling upstream changes.\n\n---\n\n### View the stack — `gh stack view`\n\nDisplay the current stack's branches, PR status, and recent commits. **Always pass `--json`** — without it, this command launches an interactive TUI that agents cannot operate.\n\n```bash\n# Always use --json\ngh stack view --json\n```\n\n| Flag | Description |\n|------|-------------|\n| `--json` | Output stack data as JSON to stdout (**required** for non-interactive use) |\n\n**`--json` output format:**\n\n```json\n{\n  \"trunk\": \"main\",\n  \"currentBranch\": \"api-routes\",\n  \"branches\": [\n    {\n      \"name\": \"auth\",\n      \"head\": \"abc1234...\",\n      \"base\": \"def5678...\",\n      \"isCurrent\": false,\n      \"isMerged\": true,\n      \"isQueued\": false,\n      \"needsRebase\": false,\n      \"pr\": {\n        \"number\": 42,\n        \"url\": \"https:\u002F\u002Fgithub.com\u002Fowner\u002Frepo\u002Fpull\u002F42\",\n        \"state\": \"MERGED\"\n      }\n    },\n    {\n      \"name\": \"api-routes\",\n      \"head\": \"789abcd...\",\n      \"base\": \"abc1234...\",\n      \"isCurrent\": true,\n      \"isMerged\": false,\n      \"isQueued\": false,\n      \"needsRebase\": false,\n      \"pr\": {\n        \"number\": 43,\n        \"url\": \"https:\u002F\u002Fgithub.com\u002Fowner\u002Frepo\u002Fpull\u002F43\",\n        \"state\": \"OPEN\"\n      }\n    }\n  ]\n}\n```\n\nFields per branch:\n- `name` — branch name\n- `head` — current HEAD SHA\n- `base` — parent branch's HEAD SHA at last sync\n- `isCurrent` — whether this is the checked-out branch\n- `isMerged` — whether the PR has been merged\n- `isQueued` — whether the PR is queued for merge (in a merge queue)\n- `needsRebase` — whether the base branch is not an ancestor (non-linear history)\n- `pr` — PR metadata (omitted if no PR exists). `state` is `\"OPEN\"`, `\"MERGED\"`, or `\"QUEUED\"`.\n\n---\n\n### Navigate the stack\n\nMove between branches without remembering branch names. These commands are fully non-interactive.\n\n```bash\ngh stack up          # Move up one branch (further from trunk)\ngh stack up 3        # Move up three branches\ngh stack down        # Move down one branch (closer to trunk)\ngh stack down 2      # Move down two branches\ngh stack top         # Jump to the top of the stack (furthest from trunk)\ngh stack bottom      # Jump to the bottom (first non-merged branch above trunk)\ngh stack trunk       # Jump to the trunk branch (e.g. main)\n```\n\nNavigation clamps to stack bounds. Merged branches are skipped when navigating from active branches.\n\n---\n\n### Check out a stack — `gh stack checkout`\n\nCheck out a stack by stack number, pull request number, PR URL, or branch name. **Always provide an argument** — running `gh stack checkout` without arguments triggers an interactive selection menu.\n\n```\ngh stack checkout \u003Cstack-number | pr-number | pr-url | branch>\n```\n\n```bash\n# By stack number (the identifier shown in the GitHub stack UI)\ngh stack checkout 7\n\n# By PR number (pulls from GitHub)\ngh stack checkout 42\n\n# By PR URL\ngh stack checkout https:\u002F\u002Fgithub.com\u002Fowner\u002Frepo\u002Fpull\u002F42\n\n# By branch name (local only)\ngh stack checkout feature-auth\n```\n\nA bare number is resolved as a **stack number first** (the identifier shown in the GitHub stack UI); if no stack has that number it is tried as a PR number, then a branch name. When a stack or PR number (or PR URL) is provided, the command fetches the stack on GitHub, pulls the branches, and sets up the stack locally. If the stack already exists locally and matches, it switches to the branch.\n\n> **⚠️ Agent warning:** If the local and remote stacks have different branch compositions, this command triggers an interactive conflict-resolution prompt that cannot be bypassed with a flag. To avoid this: run `gh stack unstack --local` first to remove the conflicting local tracking state (this keeps the stack on GitHub intact), then retry `gh stack checkout \u003Cpr-number>`.\n\nWhen a branch name is provided, the command resolves it against locally tracked stacks only. This is always safe for non-interactive use.\n\n---\n\n### Remove a stack — `gh stack unstack`\n\nTear down a stack so you can restructure it — remove a branch, reorder branches, rename branches, or make other large changes. After unstacking, use `gh stack init` to re-create the stack with the desired structure.\n\nUnstacking only removes the stack grouping (on GitHub and\u002For locally); it never deletes the underlying pull requests or branches.\n\nWith no argument, the command targets the active stack — the one containing the currently checked out branch — unstacking it on GitHub and removing local tracking.\n\nProvide a stack number to unstack a specific stack on GitHub. This works from anywhere in the repository, whether or not the stack is checked out locally — the number is unstacked directly through the GitHub API (like `gh stack link`, no local tracking required). If the stack is also tracked locally, its local tracking is removed as well.\n\n```\ngh stack unstack [\u003Cstack-number>] [flags]\n```\n\n```bash\n# Tear down the current stack — removes local tracking and the GitHub grouping (PRs are NOT deleted), then rebuild\ngh stack unstack\ngh stack init --base main branch-2 branch-1 branch-3 # reordered\n\n# Unstack a specific stack by its number, from anywhere in the repo\ngh stack unstack 7\n\n# Only remove local tracking (keep the stack on GitHub)\ngh stack unstack --local\n```\n\n| Flag | Description |\n|------|-------------|\n| `--local` | Only remove the stack locally (keep it on GitHub); never contacts GitHub |\n\n> **Note for agents:** `gh stack unstack \u003Cnumber>` is a remote-first API wrapper — it unstacks on GitHub by number from anywhere in the repo, tracked locally or not, and is safe for non-interactive use. `--local` never contacts GitHub; combining `--local` with a number that isn't tracked locally is an error. An unknown stack number returns a \"not found on GitHub\" error (exit code 2).\n\n---\n\n## Output conventions\n\n- **Status messages** go to **stderr** with emoji prefixes: `✓` (success), `✗` (error), `⚠` (warning), `ℹ` (info).\n- **Data output** (e.g., `view --json`) goes to **stdout**.\n- When piping output, use `2>\u002Fdev\u002Fnull` to suppress status messages if only data output is needed.\n\n## Exit codes and error recovery\n\n| Code | Meaning | Agent action |\n|------|---------|-------------|\n| 0 | Success | Proceed normally |\n| 1 | Generic error | Read stderr for details; may indicate commit\u002Fpush failure |\n| 2 | Not in a stack | Run `gh stack init` to create a stack first |\n| 3 | Rebase conflict | Parse stderr for conflicted file paths, resolve conflicts, run `gh stack rebase --continue` |\n| 4 | GitHub API failure | Check `gh auth status`, retry the command |\n| 5 | Invalid arguments | Fix the command invocation (check flags and arguments) |\n| 6 | Disambiguation required | A branch belongs to multiple stacks. Run `gh stack checkout \u003Cspecific-branch>` to switch to a non-shared branch first |\n| 7 | Rebase already in progress | Run `gh stack rebase --continue` (after resolving conflicts) or `gh stack rebase --abort` to start over |\n| 8 | Stack is locked | Another `gh stack` process is writing the stack file. Wait and retry — the lock times out after 5 seconds |\n| 9 | Stacked PRs unavailable | The repository does not have stacked PRs enabled. Tell the user that stacks must be enabled on the repository first |\n| 10 | Modify recovery required | A `gh stack modify` session was interrupted. This skill does not use `modify`, so agents should not produce this; if the repo is left in this state, run `gh stack modify --abort` to restore the pre-modify state |\n\n## Known limitations\n\n1. **Stacks are strictly linear.** Branching stacks (multiple children on a single parent) are not supported. Each branch has exactly one parent and at most one child. If you need parallel workstreams, use separate stacks.\n2. **Stack disambiguation cannot be bypassed.** If the current branch is the trunk of multiple stacks, commands error with code 6. Check out a non-shared branch first.\n3. **Multiple remotes require `--remote` or config.** If more than one remote is configured, set `remote.pushDefault` in git config, or pass `--remote \u003Cname>` to the commands that accept it (`push`, `submit`, `sync`, `rebase`, `link`). `checkout`, `modify`, and `trunk` have no `--remote` flag and rely on `remote.pushDefault`.\n4. **Remote stack checkout requires a stack or PR number.** `checkout` with a branch name only works with locally tracked stacks. Use a stack number or PR number (e.g. `gh stack checkout 7` or `gh stack checkout 123`) to pull a stack from GitHub.\n5. **PR title and body are auto-generated.** There is no flag to set a custom PR title or body during `submit`. The title and body are generated from commit messages plus a footer. Use `gh pr edit` to modify PR title and body after creation.\n",{"data":37,"body":40},{"name":4,"description":6,"metadata":38},{"author":8,"version":39},"0.0.9",{"type":41,"children":42},"root",[43,50,82,94,155,162,167,197,203,216,252,264,327,333,350,810,818,924,930,942,949,961,971,980,985,991,1043,1049,1074,1304,1309,1315,1334,1357,1363,1375,1385,1409,1414,1420,1966,1970,1976,1982,2801,2823,2829,2840,3111,3121,3127,3132,3347,3353,3420,3441,3474,3480,3500,3620,3640,3646,3825,3838,4292,4298,4310,4437,4440,4446,4457,4469,4478,4654,4693,4701,4745,4748,4759,4771,4780,4788,4942,4950,5054,5139,5147,5275,5278,5289,5294,5303,5374,5410,5417,5457,5465,5479,5482,5493,5517,5591,5666,5673,5746,5761,5774,5781,5816,5819,5830,5835,5844,6090,6095,6162,6169,6220,6227,6288,6291,6302,6307,6316,6368,6376,6499,6506,6687,6690,6701,6713,6722,6924,7045,7083,7099,7117,7140,7157,7160,7171,7187,7221,7262,7275,8103,8108,8219,8222,8228,8233,8395,8400,8403,8414,8433,8442,8582,8594,8620,8625,8628,8639,8651,8656,8661,8673,8682,8825,8862,8895,8898,8904,8993,8999,9295,9301,9473],{"type":44,"tag":45,"props":46,"children":47},"element","h1",{"id":4},[48],{"type":49,"value":4},"text",{"type":44,"tag":51,"props":52,"children":53},"p",{},[54,61,63,72,74,80],{"type":44,"tag":55,"props":56,"children":58},"code",{"className":57},[],[59],{"type":49,"value":60},"gh stack",{"type":49,"value":62}," is a ",{"type":44,"tag":64,"props":65,"children":69},"a",{"href":66,"rel":67},"https:\u002F\u002Fcli.github.com\u002F",[68],"nofollow",[70],{"type":49,"value":71},"GitHub CLI",{"type":49,"value":73}," extension for managing ",{"type":44,"tag":75,"props":76,"children":77},"strong",{},[78],{"type":49,"value":79},"stacked branches and pull requests",{"type":49,"value":81},". A stack is an ordered list of branches where each branch builds on the one below it, rooted on a trunk branch (typically the repo's default branch). Each branch maps to one PR whose base is the branch below it, so reviewers see only the diff for that layer.",{"type":44,"tag":83,"props":84,"children":88},"pre",{"className":85,"code":87,"language":49},[86],"language-text","main (trunk)\n └── auth-layer     → PR #1 (base: main)            - bottom (closest to trunk)\n  └── api-endpoints → PR #2 (base: auth-layer)\n   └── frontend     → PR #3 (base: api-endpoints)   - top (furthest from trunk)\n",[89],{"type":44,"tag":55,"props":90,"children":92},{"__ignoreMap":91},"",[93],{"type":49,"value":87},{"type":44,"tag":51,"props":95,"children":96},{},[97,99,104,106,111,113,119,121,127,128,133,134,139,141,146,148,153],{"type":49,"value":98},"The ",{"type":44,"tag":75,"props":100,"children":101},{},[102],{"type":49,"value":103},"bottom",{"type":49,"value":105}," of the stack is the branch closest to the trunk, and the ",{"type":44,"tag":75,"props":107,"children":108},{},[109],{"type":49,"value":110},"top",{"type":49,"value":112}," is the branch furthest from the trunk. Each branch inherits from the one below it. Navigation commands (",{"type":44,"tag":55,"props":114,"children":116},{"className":115},[],[117],{"type":49,"value":118},"up",{"type":49,"value":120},", ",{"type":44,"tag":55,"props":122,"children":124},{"className":123},[],[125],{"type":49,"value":126},"down",{"type":49,"value":120},{"type":44,"tag":55,"props":129,"children":131},{"className":130},[],[132],{"type":49,"value":110},{"type":49,"value":120},{"type":44,"tag":55,"props":135,"children":137},{"className":136},[],[138],{"type":49,"value":103},{"type":49,"value":140},") follow this model: ",{"type":44,"tag":55,"props":142,"children":144},{"className":143},[],[145],{"type":49,"value":118},{"type":49,"value":147}," moves away from trunk, ",{"type":44,"tag":55,"props":149,"children":151},{"className":150},[],[152],{"type":49,"value":126},{"type":49,"value":154}," moves toward it.",{"type":44,"tag":156,"props":157,"children":159},"h2",{"id":158},"when-to-use-this-skill",[160],{"type":49,"value":161},"When to use this skill",{"type":44,"tag":51,"props":163,"children":164},{},[165],{"type":49,"value":166},"Use this skill when the user wants to:",{"type":44,"tag":168,"props":169,"children":170},"ul",{},[171,177,182,187,192],{"type":44,"tag":172,"props":173,"children":174},"li",{},[175],{"type":49,"value":176},"Break a large change into a chain of small, reviewable PRs",{"type":44,"tag":172,"props":178,"children":179},{},[180],{"type":49,"value":181},"Create, rebase, push, or sync a stack of dependent branches",{"type":44,"tag":172,"props":183,"children":184},{},[185],{"type":49,"value":186},"Navigate between layers of a branch stack",{"type":44,"tag":172,"props":188,"children":189},{},[190],{"type":49,"value":191},"View the status of stacked PRs",{"type":44,"tag":172,"props":193,"children":194},{},[195],{"type":49,"value":196},"Tear down and rebuild a stack to remove, reorder, or rename branches",{"type":44,"tag":156,"props":198,"children":200},{"id":199},"prerequisites",[201],{"type":49,"value":202},"Prerequisites",{"type":44,"tag":51,"props":204,"children":205},{},[206,208,214],{"type":49,"value":207},"The GitHub CLI (",{"type":44,"tag":55,"props":209,"children":211},{"className":210},[],[212],{"type":49,"value":213},"gh",{"type":49,"value":215},") v2.0+ must be installed and authenticated. Install the extension with:",{"type":44,"tag":83,"props":217,"children":221},{"className":218,"code":219,"language":220,"meta":91,"style":91},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","gh extension install github\u002Fgh-stack\n","bash",[222],{"type":44,"tag":55,"props":223,"children":224},{"__ignoreMap":91},[225],{"type":44,"tag":226,"props":227,"children":230},"span",{"class":228,"line":229},"line",1,[231,236,242,247],{"type":44,"tag":226,"props":232,"children":234},{"style":233},"--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B",[235],{"type":49,"value":213},{"type":44,"tag":226,"props":237,"children":239},{"style":238},"--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D",[240],{"type":49,"value":241}," extension",{"type":44,"tag":226,"props":243,"children":244},{"style":238},[245],{"type":49,"value":246}," install",{"type":44,"tag":226,"props":248,"children":249},{"style":238},[250],{"type":49,"value":251}," github\u002Fgh-stack\n",{"type":44,"tag":51,"props":253,"children":254},{},[255,257,262],{"type":49,"value":256},"Before using ",{"type":44,"tag":55,"props":258,"children":260},{"className":259},[],[261],{"type":49,"value":60},{"type":49,"value":263},", configure git to prevent interactive prompts:",{"type":44,"tag":83,"props":265,"children":267},{"className":218,"code":266,"language":220,"meta":91,"style":91},"git config rerere.enabled true           # remember conflict resolutions (skips prompt on init)\ngit config remote.pushDefault origin     # if multiple remotes exist (skips remote picker)\n",[268],{"type":44,"tag":55,"props":269,"children":270},{"__ignoreMap":91},[271,300],{"type":44,"tag":226,"props":272,"children":273},{"class":228,"line":229},[274,278,283,288,294],{"type":44,"tag":226,"props":275,"children":276},{"style":233},[277],{"type":49,"value":19},{"type":44,"tag":226,"props":279,"children":280},{"style":238},[281],{"type":49,"value":282}," config",{"type":44,"tag":226,"props":284,"children":285},{"style":238},[286],{"type":49,"value":287}," rerere.enabled",{"type":44,"tag":226,"props":289,"children":291},{"style":290},"--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF",[292],{"type":49,"value":293}," true",{"type":44,"tag":226,"props":295,"children":297},{"style":296},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic",[298],{"type":49,"value":299},"           # remember conflict resolutions (skips prompt on init)\n",{"type":44,"tag":226,"props":301,"children":303},{"class":228,"line":302},2,[304,308,312,317,322],{"type":44,"tag":226,"props":305,"children":306},{"style":233},[307],{"type":49,"value":19},{"type":44,"tag":226,"props":309,"children":310},{"style":238},[311],{"type":49,"value":282},{"type":44,"tag":226,"props":313,"children":314},{"style":238},[315],{"type":49,"value":316}," remote.pushDefault",{"type":44,"tag":226,"props":318,"children":319},{"style":238},[320],{"type":49,"value":321}," origin",{"type":44,"tag":226,"props":323,"children":324},{"style":296},[325],{"type":49,"value":326},"     # if multiple remotes exist (skips remote picker)\n",{"type":44,"tag":156,"props":328,"children":330},{"id":329},"agent-rules",[331],{"type":49,"value":332},"Agent rules",{"type":44,"tag":51,"props":334,"children":335},{},[336,348],{"type":44,"tag":75,"props":337,"children":338},{},[339,341,346],{"type":49,"value":340},"All ",{"type":44,"tag":55,"props":342,"children":344},{"className":343},[],[345],{"type":49,"value":60},{"type":49,"value":347}," commands must be run non-interactively.",{"type":49,"value":349}," Every command invocation must include the flags and positional arguments needed to avoid prompts, TUIs, and interactive menus. If a command would prompt for input, it will hang indefinitely.",{"type":44,"tag":351,"props":352,"children":353},"ol",{},[354,403,441,477,582,592,609,643,684,724],{"type":44,"tag":172,"props":355,"children":356},{},[357,362,364,370,371,377,379,385,387,393,395,401],{"type":44,"tag":75,"props":358,"children":359},{},[360],{"type":49,"value":361},"Always supply branch names as positional arguments",{"type":49,"value":363}," to ",{"type":44,"tag":55,"props":365,"children":367},{"className":366},[],[368],{"type":49,"value":369},"init",{"type":49,"value":120},{"type":44,"tag":55,"props":372,"children":374},{"className":373},[],[375],{"type":49,"value":376},"add",{"type":49,"value":378},", and ",{"type":44,"tag":55,"props":380,"children":382},{"className":381},[],[383],{"type":49,"value":384},"checkout",{"type":49,"value":386},". Running these commands without arguments triggers interactive prompts. Branch names are used exactly as given — a name is never prefixed or transformed, so ",{"type":44,"tag":55,"props":388,"children":390},{"className":389},[],[391],{"type":49,"value":392},"gh stack add refactor\u002Ffoo",{"type":49,"value":394}," creates a branch named ",{"type":44,"tag":55,"props":396,"children":398},{"className":397},[],[399],{"type":49,"value":400},"refactor\u002Ffoo",{"type":49,"value":402},".",{"type":44,"tag":172,"props":404,"children":405},{},[406,425,427,432,433,439],{"type":44,"tag":75,"props":407,"children":408},{},[409,411,417,419],{"type":49,"value":410},"Always use ",{"type":44,"tag":55,"props":412,"children":414},{"className":413},[],[415],{"type":49,"value":416},"--auto",{"type":49,"value":418}," with ",{"type":44,"tag":55,"props":420,"children":422},{"className":421},[],[423],{"type":49,"value":424},"gh stack submit",{"type":49,"value":426}," to auto-generate PR titles. Without ",{"type":44,"tag":55,"props":428,"children":430},{"className":429},[],[431],{"type":49,"value":416},{"type":49,"value":120},{"type":44,"tag":55,"props":434,"children":436},{"className":435},[],[437],{"type":49,"value":438},"submit",{"type":49,"value":440}," prompts for a title for each new PR.",{"type":44,"tag":172,"props":442,"children":443},{},[444,462,464,469,471,476],{"type":44,"tag":75,"props":445,"children":446},{},[447,448,454,455,461],{"type":49,"value":410},{"type":44,"tag":55,"props":449,"children":451},{"className":450},[],[452],{"type":49,"value":453},"--json",{"type":49,"value":418},{"type":44,"tag":55,"props":456,"children":458},{"className":457},[],[459],{"type":49,"value":460},"gh stack view",{"type":49,"value":402},{"type":49,"value":463}," Without ",{"type":44,"tag":55,"props":465,"children":467},{"className":466},[],[468],{"type":49,"value":453},{"type":49,"value":470},", the command launches an interactive TUI that cannot be operated by agents. There is no other appropriate flag — always pass ",{"type":44,"tag":55,"props":472,"children":474},{"className":473},[],[475],{"type":49,"value":453},{"type":49,"value":402},{"type":44,"tag":172,"props":478,"children":479},{},[480,485,487,493,495,501,503,509,510,515,516,522,523,529,530,536,538,543,544,550,551,557,559,572,574,580],{"type":44,"tag":75,"props":481,"children":482},{},[483],{"type":49,"value":484},"Handle multiple remotes.",{"type":49,"value":486}," If more than one remote is configured, pre-configure ",{"type":44,"tag":55,"props":488,"children":490},{"className":489},[],[491],{"type":49,"value":492},"git config remote.pushDefault origin",{"type":49,"value":494},", or pass ",{"type":44,"tag":55,"props":496,"children":498},{"className":497},[],[499],{"type":49,"value":500},"--remote \u003Cname>",{"type":49,"value":502}," to the commands that accept it: ",{"type":44,"tag":55,"props":504,"children":506},{"className":505},[],[507],{"type":49,"value":508},"push",{"type":49,"value":120},{"type":44,"tag":55,"props":511,"children":513},{"className":512},[],[514],{"type":49,"value":438},{"type":49,"value":120},{"type":44,"tag":55,"props":517,"children":519},{"className":518},[],[520],{"type":49,"value":521},"sync",{"type":49,"value":120},{"type":44,"tag":55,"props":524,"children":526},{"className":525},[],[527],{"type":49,"value":528},"rebase",{"type":49,"value":378},{"type":44,"tag":55,"props":531,"children":533},{"className":532},[],[534],{"type":49,"value":535},"link",{"type":49,"value":537},". ",{"type":44,"tag":55,"props":539,"children":541},{"className":540},[],[542],{"type":49,"value":384},{"type":49,"value":120},{"type":44,"tag":55,"props":545,"children":547},{"className":546},[],[548],{"type":49,"value":549},"modify",{"type":49,"value":378},{"type":44,"tag":55,"props":552,"children":554},{"className":553},[],[555],{"type":49,"value":556},"trunk",{"type":49,"value":558}," resolve a remote but have ",{"type":44,"tag":75,"props":560,"children":561},{},[562,564,570],{"type":49,"value":563},"no ",{"type":44,"tag":55,"props":565,"children":567},{"className":566},[],[568],{"type":49,"value":569},"--remote",{"type":49,"value":571}," flag",{"type":49,"value":573}," — they rely on ",{"type":44,"tag":55,"props":575,"children":577},{"className":576},[],[578],{"type":49,"value":579},"remote.pushDefault",{"type":49,"value":581},". With multiple remotes and no configured default, these commands exit with an error in non-interactive mode.",{"type":44,"tag":172,"props":583,"children":584},{},[585,590],{"type":44,"tag":75,"props":586,"children":587},{},[588],{"type":49,"value":589},"Avoid branches shared across multiple stacks.",{"type":49,"value":591}," If a branch belongs to multiple stacks, commands exit with code 6. Check out a non-shared branch first.",{"type":44,"tag":172,"props":593,"children":594},{},[595,600,602,608],{"type":44,"tag":75,"props":596,"children":597},{},[598],{"type":49,"value":599},"Plan your stack layers by dependency order before writing code.",{"type":49,"value":601}," Foundational changes (models, APIs, shared utilities) go in lower branches; dependent changes (UI, consumers) go in higher branches. Think through the dependency chain before running ",{"type":44,"tag":55,"props":603,"children":605},{"className":604},[],[606],{"type":49,"value":607},"gh stack init",{"type":49,"value":402},{"type":44,"tag":172,"props":610,"children":611},{},[612,633,635,641],{"type":44,"tag":75,"props":613,"children":614},{},[615,617,623,625,631],{"type":49,"value":616},"Use standard ",{"type":44,"tag":55,"props":618,"children":620},{"className":619},[],[621],{"type":49,"value":622},"git add",{"type":49,"value":624}," and ",{"type":44,"tag":55,"props":626,"children":628},{"className":627},[],[629],{"type":49,"value":630},"git commit",{"type":49,"value":632}," for staging and committing.",{"type":49,"value":634}," This gives you full control over which changes go into each branch. The ",{"type":44,"tag":55,"props":636,"children":638},{"className":637},[],[639],{"type":49,"value":640},"-Am",{"type":49,"value":642}," shortcut is available but should not be the default approach—stacked PRs are most effective when each branch contains a deliberate, logical set of changes.",{"type":44,"tag":172,"props":644,"children":645},{},[646,651,653,659,660,666,668,674,676,682],{"type":44,"tag":75,"props":647,"children":648},{},[649],{"type":49,"value":650},"Navigate down the stack when you need to change a lower layer.",{"type":49,"value":652}," If you're working on a frontend branch and realize you need API changes, don't hack around it at the current layer. Navigate to the appropriate branch (",{"type":44,"tag":55,"props":654,"children":656},{"className":655},[],[657],{"type":49,"value":658},"gh stack down",{"type":49,"value":120},{"type":44,"tag":55,"props":661,"children":663},{"className":662},[],[664],{"type":49,"value":665},"gh stack checkout",{"type":49,"value":667},", or ",{"type":44,"tag":55,"props":669,"children":671},{"className":670},[],[672],{"type":49,"value":673},"gh stack bottom",{"type":49,"value":675},"), make and commit the changes there, run ",{"type":44,"tag":55,"props":677,"children":679},{"className":678},[],[680],{"type":49,"value":681},"gh stack rebase --upstack",{"type":49,"value":683},", then navigate back up to continue.",{"type":44,"tag":172,"props":685,"children":686},{},[687,700,702,708,709,714,716,722],{"type":44,"tag":75,"props":688,"children":689},{},[690,692,698],{"type":49,"value":691},"Use ",{"type":44,"tag":55,"props":693,"children":695},{"className":694},[],[696],{"type":49,"value":697},"gh stack link",{"type":49,"value":699}," for external tool workflows.",{"type":49,"value":701}," When branches are managed by an external tool (jj, Sapling, etc.), use ",{"type":44,"tag":55,"props":703,"children":705},{"className":704},[],[706],{"type":49,"value":707},"gh stack link branch-a branch-b",{"type":49,"value":537},{"type":44,"tag":55,"props":710,"children":712},{"className":711},[],[713],{"type":49,"value":535},{"type":49,"value":715}," does not rely on local tracking state and is intended for API-driven PR and stack management. Provide at least two branches\u002FPRs to create or update a stack, or a stack number followed by the new branches\u002FPRs to append them to the top of an existing stack (e.g. ",{"type":44,"tag":55,"props":717,"children":719},{"className":718},[],[720],{"type":49,"value":721},"gh stack link 7 branch-c",{"type":49,"value":723},").",{"type":44,"tag":172,"props":725,"children":726},{},[727,739,741,747,749,755,757,763,765,771,773,779,781,787,788,794,795,801,802,808],{"type":44,"tag":75,"props":728,"children":729},{},[730,731,737],{"type":49,"value":691},{"type":44,"tag":55,"props":732,"children":734},{"className":733},[],[735],{"type":49,"value":736},"gh stack merge --yes",{"type":49,"value":738}," to merge stacked PRs.",{"type":49,"value":740}," ",{"type":44,"tag":55,"props":742,"children":744},{"className":743},[],[745],{"type":49,"value":746},"gh pr merge",{"type":49,"value":748}," does not work with stacked PRs. In a non-interactive terminal ",{"type":44,"tag":55,"props":750,"children":752},{"className":751},[],[753],{"type":49,"value":754},"gh stack merge",{"type":49,"value":756}," runs without prompting and merges the entire stack (bottom to top) atomically; pass ",{"type":44,"tag":55,"props":758,"children":760},{"className":759},[],[761],{"type":49,"value":762},"--yes",{"type":49,"value":764}," to be explicit. Scope the merge by passing a pull request number (",{"type":44,"tag":55,"props":766,"children":768},{"className":767},[],[769],{"type":49,"value":770},"gh stack merge 42 --yes",{"type":49,"value":772}," merges everything up to and including PR #42) or a stack number (",{"type":44,"tag":55,"props":774,"children":776},{"className":775},[],[777],{"type":49,"value":778},"gh stack merge 7 --yes",{"type":49,"value":780},", which needs no local checkout). Choose the method with ",{"type":44,"tag":55,"props":782,"children":784},{"className":783},[],[785],{"type":49,"value":786},"--squash",{"type":49,"value":120},{"type":44,"tag":55,"props":789,"children":791},{"className":790},[],[792],{"type":49,"value":793},"--rebase",{"type":49,"value":120},{"type":44,"tag":55,"props":796,"children":798},{"className":797},[],[799],{"type":49,"value":800},"--merge",{"type":49,"value":667},{"type":44,"tag":55,"props":803,"children":805},{"className":804},[],[806],{"type":49,"value":807},"--merge-method \u003Cmethod>",{"type":49,"value":809},"; without one, the last-used method is used. The merge is all-or-nothing — if any PR can't be merged, none are, and the failure reason is reported. Only basic pull request state is checked before merging (open and not a draft); bypassing merge requirements is not supported for stacks. If the base branch uses a merge queue, the stack is added to the queue instead of merging directly: the queue chooses the merge method (any method you pass is ignored with a warning), and the pull requests are added to the queue together but merge as the queue processes them, so they may land in separate groups rather than all at once.",{"type":44,"tag":51,"props":811,"children":812},{},[813],{"type":44,"tag":75,"props":814,"children":815},{},[816],{"type":49,"value":817},"Never do any of the following — each triggers an interactive prompt or TUI that will hang:",{"type":44,"tag":168,"props":819,"children":820},{},[821,847,870,881,893,904],{"type":44,"tag":172,"props":822,"children":823},{},[824,826,831,833,839,841],{"type":49,"value":825},"❌ ",{"type":44,"tag":55,"props":827,"children":829},{"className":828},[],[830],{"type":49,"value":460},{"type":49,"value":832}," or ",{"type":44,"tag":55,"props":834,"children":836},{"className":835},[],[837],{"type":49,"value":838},"gh stack view --short",{"type":49,"value":840}," — always use ",{"type":44,"tag":55,"props":842,"children":844},{"className":843},[],[845],{"type":49,"value":846},"gh stack view --json",{"type":44,"tag":172,"props":848,"children":849},{},[850,851,856,858,863,864],{"type":49,"value":825},{"type":44,"tag":55,"props":852,"children":854},{"className":853},[],[855],{"type":49,"value":424},{"type":49,"value":857}," without ",{"type":44,"tag":55,"props":859,"children":861},{"className":860},[],[862],{"type":49,"value":416},{"type":49,"value":840},{"type":44,"tag":55,"props":865,"children":867},{"className":866},[],[868],{"type":49,"value":869},"gh stack submit --auto",{"type":44,"tag":172,"props":871,"children":872},{},[873,874,879],{"type":49,"value":825},{"type":44,"tag":55,"props":875,"children":877},{"className":876},[],[878],{"type":49,"value":607},{"type":49,"value":880}," without branch arguments — always provide branch names",{"type":44,"tag":172,"props":882,"children":883},{},[884,885,891],{"type":49,"value":825},{"type":44,"tag":55,"props":886,"children":888},{"className":887},[],[889],{"type":49,"value":890},"gh stack add",{"type":49,"value":892}," without a branch name — always provide a branch name",{"type":44,"tag":172,"props":894,"children":895},{},[896,897,902],{"type":49,"value":825},{"type":44,"tag":55,"props":898,"children":900},{"className":899},[],[901],{"type":49,"value":665},{"type":49,"value":903}," without an argument — always provide a PR number or branch name",{"type":44,"tag":172,"props":905,"children":906},{},[907,908,914,916,922],{"type":49,"value":825},{"type":44,"tag":55,"props":909,"children":911},{"className":910},[],[912],{"type":49,"value":913},"gh stack checkout \u003Cpr-number>",{"type":49,"value":915}," when a different local stack already exists on those branches — this triggers an unbypassable conflict resolution prompt; use ",{"type":44,"tag":55,"props":917,"children":919},{"className":918},[],[920],{"type":49,"value":921},"gh stack unstack --local",{"type":49,"value":923}," first to remove the local tracking state (this keeps the stack on GitHub intact), then retry the checkout",{"type":44,"tag":156,"props":925,"children":927},{"id":926},"thinking-about-stack-structure",[928],{"type":49,"value":929},"Thinking about stack structure",{"type":44,"tag":51,"props":931,"children":932},{},[933,935,940],{"type":49,"value":934},"Each branch in a stack should represent a ",{"type":44,"tag":75,"props":936,"children":937},{},[938],{"type":49,"value":939},"discrete, logical unit of work",{"type":49,"value":941}," that can be reviewed independently. The changes within a branch should be cohesive—they belong together and make sense as a single PR.",{"type":44,"tag":943,"props":944,"children":946},"h3",{"id":945},"dependency-chain",[947],{"type":49,"value":948},"Dependency chain",{"type":44,"tag":51,"props":950,"children":951},{},[952,954,959],{"type":49,"value":953},"Stacked branches form a dependency chain: each branch builds on the one below it. This means ",{"type":44,"tag":75,"props":955,"children":956},{},[957],{"type":49,"value":958},"foundational changes must go in lower (earlier) branches",{"type":49,"value":960},", and code that depends on them goes in higher (later) branches.",{"type":44,"tag":51,"props":962,"children":963},{},[964,969],{"type":44,"tag":75,"props":965,"children":966},{},[967],{"type":49,"value":968},"Plan your layers before writing code.",{"type":49,"value":970}," For example, a full-stack feature might be structured like this (use branch names relevant to your actual task, not these generic ones):",{"type":44,"tag":83,"props":972,"children":975},{"className":973,"code":974,"language":49},[86],"main (trunk)\n └── data-models    ← shared types, database schema\n  └── api-endpoints ← API routes that use the models\n   └── frontend-ui  ← UI components that call the APIs\n    └── integration ← tests that exercise the full stack\n",[976],{"type":44,"tag":55,"props":977,"children":978},{"__ignoreMap":91},[979],{"type":49,"value":974},{"type":44,"tag":51,"props":981,"children":982},{},[983],{"type":49,"value":984},"This is illustrative — choose branch names and layer boundaries that reflect the specific work you're doing. The key principle is: if code in one layer depends on code in another, the dependency must be in the same branch or a lower one.",{"type":44,"tag":943,"props":986,"children":988},{"id":987},"branch-naming",[989],{"type":49,"value":990},"Branch naming",{"type":44,"tag":51,"props":992,"children":993},{},[994,996,1002,1003,1009,1010,1016,1018,1023,1024,1029,1031,1036,1037,1042],{"type":49,"value":995},"Choose a clear, descriptive branch name for each layer that reflects the concern it contains (e.g., ",{"type":44,"tag":55,"props":997,"children":999},{"className":998},[],[1000],{"type":49,"value":1001},"auth",{"type":49,"value":120},{"type":44,"tag":55,"props":1004,"children":1006},{"className":1005},[],[1007],{"type":49,"value":1008},"api-routes",{"type":49,"value":120},{"type":44,"tag":55,"props":1011,"children":1013},{"className":1012},[],[1014],{"type":49,"value":1015},"frontend",{"type":49,"value":1017},"). Branch names are used exactly as you provide them to ",{"type":44,"tag":55,"props":1019,"children":1021},{"className":1020},[],[1022],{"type":49,"value":369},{"type":49,"value":624},{"type":44,"tag":55,"props":1025,"children":1027},{"className":1026},[],[1028],{"type":49,"value":376},{"type":49,"value":1030}," — nothing is prepended or transformed. Slashes are allowed and are treated as part of the name (e.g., ",{"type":44,"tag":55,"props":1032,"children":1034},{"className":1033},[],[1035],{"type":49,"value":392},{"type":49,"value":394},{"type":44,"tag":55,"props":1038,"children":1040},{"className":1039},[],[1041],{"type":49,"value":400},{"type":49,"value":723},{"type":44,"tag":943,"props":1044,"children":1046},{"id":1045},"staging-changes-deliberately",[1047],{"type":49,"value":1048},"Staging changes deliberately",{"type":44,"tag":51,"props":1050,"children":1051},{},[1052,1054,1059,1060,1065,1067,1072],{"type":49,"value":1053},"The main reason to use ",{"type":44,"tag":55,"props":1055,"children":1057},{"className":1056},[],[1058],{"type":49,"value":622},{"type":49,"value":624},{"type":44,"tag":55,"props":1061,"children":1063},{"className":1062},[],[1064],{"type":49,"value":630},{"type":49,"value":1066}," directly is to control ",{"type":44,"tag":75,"props":1068,"children":1069},{},[1070],{"type":49,"value":1071},"which changes go into which branch",{"type":49,"value":1073},". When you have multiple files in your working tree, you can stage a subset for the current branch, commit them, then create a new branch and stage the rest there:",{"type":44,"tag":83,"props":1075,"children":1077},{"className":218,"code":1076,"language":220,"meta":91,"style":91},"# You're on data-models with several new files in your working tree.\n# Stage only the model files for this branch:\ngit add internal\u002Fmodels\u002Fuser.go internal\u002Fmodels\u002Fsession.go\ngit commit -m \"Add user and session models\"\n\ngit add db\u002Fmigrations\u002F001_create_users.sql\ngit commit -m \"Add user table migration\"\n\n# Now create a new branch for the API layer and stage the API files there:\ngh stack add api-routes # created & switched to the api-routes branch\ngit add internal\u002Fapi\u002Froutes.go internal\u002Fapi\u002Fhandlers.go\ngit commit -m \"Add user API routes\"\n",[1078],{"type":44,"tag":55,"props":1079,"children":1080},{"__ignoreMap":91},[1081,1089,1097,1120,1153,1163,1180,1209,1217,1226,1253,1275],{"type":44,"tag":226,"props":1082,"children":1083},{"class":228,"line":229},[1084],{"type":44,"tag":226,"props":1085,"children":1086},{"style":296},[1087],{"type":49,"value":1088},"# You're on data-models with several new files in your working tree.\n",{"type":44,"tag":226,"props":1090,"children":1091},{"class":228,"line":302},[1092],{"type":44,"tag":226,"props":1093,"children":1094},{"style":296},[1095],{"type":49,"value":1096},"# Stage only the model files for this branch:\n",{"type":44,"tag":226,"props":1098,"children":1100},{"class":228,"line":1099},3,[1101,1105,1110,1115],{"type":44,"tag":226,"props":1102,"children":1103},{"style":233},[1104],{"type":49,"value":19},{"type":44,"tag":226,"props":1106,"children":1107},{"style":238},[1108],{"type":49,"value":1109}," add",{"type":44,"tag":226,"props":1111,"children":1112},{"style":238},[1113],{"type":49,"value":1114}," internal\u002Fmodels\u002Fuser.go",{"type":44,"tag":226,"props":1116,"children":1117},{"style":238},[1118],{"type":49,"value":1119}," internal\u002Fmodels\u002Fsession.go\n",{"type":44,"tag":226,"props":1121,"children":1123},{"class":228,"line":1122},4,[1124,1128,1133,1138,1143,1148],{"type":44,"tag":226,"props":1125,"children":1126},{"style":233},[1127],{"type":49,"value":19},{"type":44,"tag":226,"props":1129,"children":1130},{"style":238},[1131],{"type":49,"value":1132}," commit",{"type":44,"tag":226,"props":1134,"children":1135},{"style":238},[1136],{"type":49,"value":1137}," -m",{"type":44,"tag":226,"props":1139,"children":1140},{"style":290},[1141],{"type":49,"value":1142}," \"",{"type":44,"tag":226,"props":1144,"children":1145},{"style":238},[1146],{"type":49,"value":1147},"Add user and session models",{"type":44,"tag":226,"props":1149,"children":1150},{"style":290},[1151],{"type":49,"value":1152},"\"\n",{"type":44,"tag":226,"props":1154,"children":1156},{"class":228,"line":1155},5,[1157],{"type":44,"tag":226,"props":1158,"children":1160},{"emptyLinePlaceholder":1159},true,[1161],{"type":49,"value":1162},"\n",{"type":44,"tag":226,"props":1164,"children":1166},{"class":228,"line":1165},6,[1167,1171,1175],{"type":44,"tag":226,"props":1168,"children":1169},{"style":233},[1170],{"type":49,"value":19},{"type":44,"tag":226,"props":1172,"children":1173},{"style":238},[1174],{"type":49,"value":1109},{"type":44,"tag":226,"props":1176,"children":1177},{"style":238},[1178],{"type":49,"value":1179}," db\u002Fmigrations\u002F001_create_users.sql\n",{"type":44,"tag":226,"props":1181,"children":1183},{"class":228,"line":1182},7,[1184,1188,1192,1196,1200,1205],{"type":44,"tag":226,"props":1185,"children":1186},{"style":233},[1187],{"type":49,"value":19},{"type":44,"tag":226,"props":1189,"children":1190},{"style":238},[1191],{"type":49,"value":1132},{"type":44,"tag":226,"props":1193,"children":1194},{"style":238},[1195],{"type":49,"value":1137},{"type":44,"tag":226,"props":1197,"children":1198},{"style":290},[1199],{"type":49,"value":1142},{"type":44,"tag":226,"props":1201,"children":1202},{"style":238},[1203],{"type":49,"value":1204},"Add user table migration",{"type":44,"tag":226,"props":1206,"children":1207},{"style":290},[1208],{"type":49,"value":1152},{"type":44,"tag":226,"props":1210,"children":1212},{"class":228,"line":1211},8,[1213],{"type":44,"tag":226,"props":1214,"children":1215},{"emptyLinePlaceholder":1159},[1216],{"type":49,"value":1162},{"type":44,"tag":226,"props":1218,"children":1220},{"class":228,"line":1219},9,[1221],{"type":44,"tag":226,"props":1222,"children":1223},{"style":296},[1224],{"type":49,"value":1225},"# Now create a new branch for the API layer and stage the API files there:\n",{"type":44,"tag":226,"props":1227,"children":1229},{"class":228,"line":1228},10,[1230,1234,1239,1243,1248],{"type":44,"tag":226,"props":1231,"children":1232},{"style":233},[1233],{"type":49,"value":213},{"type":44,"tag":226,"props":1235,"children":1236},{"style":238},[1237],{"type":49,"value":1238}," stack",{"type":44,"tag":226,"props":1240,"children":1241},{"style":238},[1242],{"type":49,"value":1109},{"type":44,"tag":226,"props":1244,"children":1245},{"style":238},[1246],{"type":49,"value":1247}," api-routes",{"type":44,"tag":226,"props":1249,"children":1250},{"style":296},[1251],{"type":49,"value":1252}," # created & switched to the api-routes branch\n",{"type":44,"tag":226,"props":1254,"children":1256},{"class":228,"line":1255},11,[1257,1261,1265,1270],{"type":44,"tag":226,"props":1258,"children":1259},{"style":233},[1260],{"type":49,"value":19},{"type":44,"tag":226,"props":1262,"children":1263},{"style":238},[1264],{"type":49,"value":1109},{"type":44,"tag":226,"props":1266,"children":1267},{"style":238},[1268],{"type":49,"value":1269}," internal\u002Fapi\u002Froutes.go",{"type":44,"tag":226,"props":1271,"children":1272},{"style":238},[1273],{"type":49,"value":1274}," internal\u002Fapi\u002Fhandlers.go\n",{"type":44,"tag":226,"props":1276,"children":1278},{"class":228,"line":1277},12,[1279,1283,1287,1291,1295,1300],{"type":44,"tag":226,"props":1280,"children":1281},{"style":233},[1282],{"type":49,"value":19},{"type":44,"tag":226,"props":1284,"children":1285},{"style":238},[1286],{"type":49,"value":1132},{"type":44,"tag":226,"props":1288,"children":1289},{"style":238},[1290],{"type":49,"value":1137},{"type":44,"tag":226,"props":1292,"children":1293},{"style":290},[1294],{"type":49,"value":1142},{"type":44,"tag":226,"props":1296,"children":1297},{"style":238},[1298],{"type":49,"value":1299},"Add user API routes",{"type":44,"tag":226,"props":1301,"children":1302},{"style":290},[1303],{"type":49,"value":1152},{"type":44,"tag":51,"props":1305,"children":1306},{},[1307],{"type":49,"value":1308},"This keeps each branch focused on one concern. Multiple commits per branch are fine — the key is that all commits in a branch relate to the same logical concern, and changes that belong to a different concern go in a different branch.",{"type":44,"tag":943,"props":1310,"children":1312},{"id":1311},"when-to-create-a-new-branch",[1313],{"type":49,"value":1314},"When to create a new branch",{"type":44,"tag":51,"props":1316,"children":1317},{},[1318,1320,1325,1327,1332],{"type":49,"value":1319},"Create a new branch (",{"type":44,"tag":55,"props":1321,"children":1323},{"className":1322},[],[1324],{"type":49,"value":890},{"type":49,"value":1326},") when you're starting a ",{"type":44,"tag":75,"props":1328,"children":1329},{},[1330],{"type":49,"value":1331},"different concern",{"type":49,"value":1333}," that depends on what you've built so far. Signs it's time for a new branch:",{"type":44,"tag":168,"props":1335,"children":1336},{},[1337,1342,1347,1352],{"type":44,"tag":172,"props":1338,"children":1339},{},[1340],{"type":49,"value":1341},"You're switching from backend to frontend work",{"type":44,"tag":172,"props":1343,"children":1344},{},[1345],{"type":49,"value":1346},"You're moving from core logic to tests or documentation",{"type":44,"tag":172,"props":1348,"children":1349},{},[1350],{"type":49,"value":1351},"The next set of changes has a different reviewer audience",{"type":44,"tag":172,"props":1353,"children":1354},{},[1355],{"type":49,"value":1356},"The current branch's PR is already large enough to review",{"type":44,"tag":943,"props":1358,"children":1360},{"id":1359},"one-stack-one-story",[1361],{"type":49,"value":1362},"One stack, one story",{"type":44,"tag":51,"props":1364,"children":1365},{},[1366,1368,1373],{"type":49,"value":1367},"Think of a stack from the reviewer's perspective: the stack of PRs should ",{"type":44,"tag":75,"props":1369,"children":1370},{},[1371],{"type":49,"value":1372},"tell a cohesive story",{"type":49,"value":1374}," about a feature or project. A reviewer should be able to read the PRs in sequence and understand the progression of changes, with each PR being a small, logical piece of the whole.",{"type":44,"tag":51,"props":1376,"children":1377},{},[1378,1383],{"type":44,"tag":75,"props":1379,"children":1380},{},[1381],{"type":49,"value":1382},"When to use a single stack:",{"type":49,"value":1384}," All the branches are part of the same feature, project, or closely related effort. Even if the work spans multiple concerns (models, API, frontend), they're all building toward the same goal.",{"type":44,"tag":51,"props":1386,"children":1387},{},[1388,1393,1395,1400,1402,1407],{"type":44,"tag":75,"props":1389,"children":1390},{},[1391],{"type":49,"value":1392},"When to create a separate stack:",{"type":49,"value":1394}," The work is unrelated to your current stack — a different feature, a bug fix in an unrelated area, or an independent refactor. Don't mix unrelated work into a single stack just because you happen to be working on both. Start a new stack with ",{"type":44,"tag":55,"props":1396,"children":1398},{"className":1397},[],[1399],{"type":49,"value":607},{"type":49,"value":1401}," or switch to an existing stack with ",{"type":44,"tag":55,"props":1403,"children":1405},{"className":1404},[],[1406],{"type":49,"value":665},{"type":49,"value":1408}," for each distinct effort.",{"type":44,"tag":51,"props":1410,"children":1411},{},[1412],{"type":49,"value":1413},"Small, incidental fixes (e.g., fixing a typo you noticed) can go in the current stack if they're trivial. But if a change grows into its own project, it deserves its own stack.",{"type":44,"tag":156,"props":1415,"children":1417},{"id":1416},"quick-reference",[1418],{"type":49,"value":1419},"Quick reference",{"type":44,"tag":1421,"props":1422,"children":1423},"table",{},[1424,1443],{"type":44,"tag":1425,"props":1426,"children":1427},"thead",{},[1428],{"type":44,"tag":1429,"props":1430,"children":1431},"tr",{},[1432,1438],{"type":44,"tag":1433,"props":1434,"children":1435},"th",{},[1436],{"type":49,"value":1437},"Task",{"type":44,"tag":1433,"props":1439,"children":1440},{},[1441],{"type":49,"value":1442},"Command",{"type":44,"tag":1444,"props":1445,"children":1446},"tbody",{},[1447,1465,1482,1499,1516,1533,1550,1567,1584,1600,1617,1634,1651,1668,1685,1701,1718,1735,1752,1768,1793,1816,1833,1850,1867,1884,1901,1917,1933,1949],{"type":44,"tag":1429,"props":1448,"children":1449},{},[1450,1456],{"type":44,"tag":1451,"props":1452,"children":1453},"td",{},[1454],{"type":49,"value":1455},"Create a stack",{"type":44,"tag":1451,"props":1457,"children":1458},{},[1459],{"type":44,"tag":55,"props":1460,"children":1462},{"className":1461},[],[1463],{"type":49,"value":1464},"gh stack init auth",{"type":44,"tag":1429,"props":1466,"children":1467},{},[1468,1473],{"type":44,"tag":1451,"props":1469,"children":1470},{},[1471],{"type":49,"value":1472},"Create a stack of multiple branches",{"type":44,"tag":1451,"props":1474,"children":1475},{},[1476],{"type":44,"tag":55,"props":1477,"children":1479},{"className":1478},[],[1480],{"type":49,"value":1481},"gh stack init auth api frontend",{"type":44,"tag":1429,"props":1483,"children":1484},{},[1485,1490],{"type":44,"tag":1451,"props":1486,"children":1487},{},[1488],{"type":49,"value":1489},"Adopt existing branches",{"type":44,"tag":1451,"props":1491,"children":1492},{},[1493],{"type":44,"tag":55,"props":1494,"children":1496},{"className":1495},[],[1497],{"type":49,"value":1498},"gh stack init existing-branch-a existing-branch-b",{"type":44,"tag":1429,"props":1500,"children":1501},{},[1502,1507],{"type":44,"tag":1451,"props":1503,"children":1504},{},[1505],{"type":49,"value":1506},"Set custom trunk",{"type":44,"tag":1451,"props":1508,"children":1509},{},[1510],{"type":44,"tag":55,"props":1511,"children":1513},{"className":1512},[],[1514],{"type":49,"value":1515},"gh stack init --base develop branch-a",{"type":44,"tag":1429,"props":1517,"children":1518},{},[1519,1524],{"type":44,"tag":1451,"props":1520,"children":1521},{},[1522],{"type":49,"value":1523},"Add a branch to stack",{"type":44,"tag":1451,"props":1525,"children":1526},{},[1527],{"type":44,"tag":55,"props":1528,"children":1530},{"className":1529},[],[1531],{"type":49,"value":1532},"gh stack add api-routes",{"type":44,"tag":1429,"props":1534,"children":1535},{},[1536,1541],{"type":44,"tag":1451,"props":1537,"children":1538},{},[1539],{"type":49,"value":1540},"Add branch + stage all + commit",{"type":44,"tag":1451,"props":1542,"children":1543},{},[1544],{"type":44,"tag":55,"props":1545,"children":1547},{"className":1546},[],[1548],{"type":49,"value":1549},"gh stack add -Am \"message\" api-routes",{"type":44,"tag":1429,"props":1551,"children":1552},{},[1553,1558],{"type":44,"tag":1451,"props":1554,"children":1555},{},[1556],{"type":49,"value":1557},"Push branches to remote",{"type":44,"tag":1451,"props":1559,"children":1560},{},[1561],{"type":44,"tag":55,"props":1562,"children":1564},{"className":1563},[],[1565],{"type":49,"value":1566},"gh stack push",{"type":44,"tag":1429,"props":1568,"children":1569},{},[1570,1575],{"type":44,"tag":1451,"props":1571,"children":1572},{},[1573],{"type":49,"value":1574},"Push to specific remote",{"type":44,"tag":1451,"props":1576,"children":1577},{},[1578],{"type":44,"tag":55,"props":1579,"children":1581},{"className":1580},[],[1582],{"type":49,"value":1583},"gh stack push --remote origin",{"type":44,"tag":1429,"props":1585,"children":1586},{},[1587,1592],{"type":44,"tag":1451,"props":1588,"children":1589},{},[1590],{"type":49,"value":1591},"Push branches + create draft PRs",{"type":44,"tag":1451,"props":1593,"children":1594},{},[1595],{"type":44,"tag":55,"props":1596,"children":1598},{"className":1597},[],[1599],{"type":49,"value":869},{"type":44,"tag":1429,"props":1601,"children":1602},{},[1603,1608],{"type":44,"tag":1451,"props":1604,"children":1605},{},[1606],{"type":49,"value":1607},"Create PRs as ready for review",{"type":44,"tag":1451,"props":1609,"children":1610},{},[1611],{"type":44,"tag":55,"props":1612,"children":1614},{"className":1613},[],[1615],{"type":49,"value":1616},"gh stack submit --auto --open",{"type":44,"tag":1429,"props":1618,"children":1619},{},[1620,1625],{"type":44,"tag":1451,"props":1621,"children":1622},{},[1623],{"type":49,"value":1624},"Sync (fetch, rebase, push)",{"type":44,"tag":1451,"props":1626,"children":1627},{},[1628],{"type":44,"tag":55,"props":1629,"children":1631},{"className":1630},[],[1632],{"type":49,"value":1633},"gh stack sync",{"type":44,"tag":1429,"props":1635,"children":1636},{},[1637,1642],{"type":44,"tag":1451,"props":1638,"children":1639},{},[1640],{"type":49,"value":1641},"Sync with specific remote",{"type":44,"tag":1451,"props":1643,"children":1644},{},[1645],{"type":44,"tag":55,"props":1646,"children":1648},{"className":1647},[],[1649],{"type":49,"value":1650},"gh stack sync --remote origin",{"type":44,"tag":1429,"props":1652,"children":1653},{},[1654,1659],{"type":44,"tag":1451,"props":1655,"children":1656},{},[1657],{"type":49,"value":1658},"Sync and prune merged branches",{"type":44,"tag":1451,"props":1660,"children":1661},{},[1662],{"type":44,"tag":55,"props":1663,"children":1665},{"className":1664},[],[1666],{"type":49,"value":1667},"gh stack sync --prune",{"type":44,"tag":1429,"props":1669,"children":1670},{},[1671,1676],{"type":44,"tag":1451,"props":1672,"children":1673},{},[1674],{"type":49,"value":1675},"Rebase entire stack",{"type":44,"tag":1451,"props":1677,"children":1678},{},[1679],{"type":44,"tag":55,"props":1680,"children":1682},{"className":1681},[],[1683],{"type":49,"value":1684},"gh stack rebase",{"type":44,"tag":1429,"props":1686,"children":1687},{},[1688,1693],{"type":44,"tag":1451,"props":1689,"children":1690},{},[1691],{"type":49,"value":1692},"Rebase upstack only",{"type":44,"tag":1451,"props":1694,"children":1695},{},[1696],{"type":44,"tag":55,"props":1697,"children":1699},{"className":1698},[],[1700],{"type":49,"value":681},{"type":44,"tag":1429,"props":1702,"children":1703},{},[1704,1709],{"type":44,"tag":1451,"props":1705,"children":1706},{},[1707],{"type":49,"value":1708},"Rebase without trunk",{"type":44,"tag":1451,"props":1710,"children":1711},{},[1712],{"type":44,"tag":55,"props":1713,"children":1715},{"className":1714},[],[1716],{"type":49,"value":1717},"gh stack rebase --no-trunk",{"type":44,"tag":1429,"props":1719,"children":1720},{},[1721,1726],{"type":44,"tag":1451,"props":1722,"children":1723},{},[1724],{"type":49,"value":1725},"Continue after conflict",{"type":44,"tag":1451,"props":1727,"children":1728},{},[1729],{"type":44,"tag":55,"props":1730,"children":1732},{"className":1731},[],[1733],{"type":49,"value":1734},"gh stack rebase --continue",{"type":44,"tag":1429,"props":1736,"children":1737},{},[1738,1743],{"type":44,"tag":1451,"props":1739,"children":1740},{},[1741],{"type":49,"value":1742},"Abort rebase",{"type":44,"tag":1451,"props":1744,"children":1745},{},[1746],{"type":44,"tag":55,"props":1747,"children":1749},{"className":1748},[],[1750],{"type":49,"value":1751},"gh stack rebase --abort",{"type":44,"tag":1429,"props":1753,"children":1754},{},[1755,1760],{"type":44,"tag":1451,"props":1756,"children":1757},{},[1758],{"type":49,"value":1759},"View stack details (JSON)",{"type":44,"tag":1451,"props":1761,"children":1762},{},[1763],{"type":44,"tag":55,"props":1764,"children":1766},{"className":1765},[],[1767],{"type":49,"value":846},{"type":44,"tag":1429,"props":1769,"children":1770},{},[1771,1776],{"type":44,"tag":1451,"props":1772,"children":1773},{},[1774],{"type":49,"value":1775},"Switch branches up\u002Fdown in stack",{"type":44,"tag":1451,"props":1777,"children":1778},{},[1779,1785,1787],{"type":44,"tag":55,"props":1780,"children":1782},{"className":1781},[],[1783],{"type":49,"value":1784},"gh stack up [n]",{"type":49,"value":1786}," \u002F ",{"type":44,"tag":55,"props":1788,"children":1790},{"className":1789},[],[1791],{"type":49,"value":1792},"gh stack down [n]",{"type":44,"tag":1429,"props":1794,"children":1795},{},[1796,1801],{"type":44,"tag":1451,"props":1797,"children":1798},{},[1799],{"type":49,"value":1800},"Switch to top\u002Fbottom branch",{"type":44,"tag":1451,"props":1802,"children":1803},{},[1804,1810,1811],{"type":44,"tag":55,"props":1805,"children":1807},{"className":1806},[],[1808],{"type":49,"value":1809},"gh stack top",{"type":49,"value":1786},{"type":44,"tag":55,"props":1812,"children":1814},{"className":1813},[],[1815],{"type":49,"value":673},{"type":44,"tag":1429,"props":1817,"children":1818},{},[1819,1824],{"type":44,"tag":1451,"props":1820,"children":1821},{},[1822],{"type":49,"value":1823},"Check out by stack number",{"type":44,"tag":1451,"props":1825,"children":1826},{},[1827],{"type":44,"tag":55,"props":1828,"children":1830},{"className":1829},[],[1831],{"type":49,"value":1832},"gh stack checkout 7",{"type":44,"tag":1429,"props":1834,"children":1835},{},[1836,1841],{"type":44,"tag":1451,"props":1837,"children":1838},{},[1839],{"type":49,"value":1840},"Check out by PR",{"type":44,"tag":1451,"props":1842,"children":1843},{},[1844],{"type":44,"tag":55,"props":1845,"children":1847},{"className":1846},[],[1848],{"type":49,"value":1849},"gh stack checkout 42",{"type":44,"tag":1429,"props":1851,"children":1852},{},[1853,1858],{"type":44,"tag":1451,"props":1854,"children":1855},{},[1856],{"type":49,"value":1857},"Check out by branch (local only)",{"type":44,"tag":1451,"props":1859,"children":1860},{},[1861],{"type":44,"tag":55,"props":1862,"children":1864},{"className":1863},[],[1865],{"type":49,"value":1866},"gh stack checkout feature-auth",{"type":44,"tag":1429,"props":1868,"children":1869},{},[1870,1875],{"type":44,"tag":1451,"props":1871,"children":1872},{},[1873],{"type":49,"value":1874},"Tear down the current stack to restructure it",{"type":44,"tag":1451,"props":1876,"children":1877},{},[1878],{"type":44,"tag":55,"props":1879,"children":1881},{"className":1880},[],[1882],{"type":49,"value":1883},"gh stack unstack",{"type":44,"tag":1429,"props":1885,"children":1886},{},[1887,1892],{"type":44,"tag":1451,"props":1888,"children":1889},{},[1890],{"type":49,"value":1891},"Tear down a specific stack by number",{"type":44,"tag":1451,"props":1893,"children":1894},{},[1895],{"type":44,"tag":55,"props":1896,"children":1898},{"className":1897},[],[1899],{"type":49,"value":1900},"gh stack unstack 7",{"type":44,"tag":1429,"props":1902,"children":1903},{},[1904,1909],{"type":44,"tag":1451,"props":1905,"children":1906},{},[1907],{"type":49,"value":1908},"Merge the whole current stack",{"type":44,"tag":1451,"props":1910,"children":1911},{},[1912],{"type":44,"tag":55,"props":1913,"children":1915},{"className":1914},[],[1916],{"type":49,"value":736},{"type":44,"tag":1429,"props":1918,"children":1919},{},[1920,1925],{"type":44,"tag":1451,"props":1921,"children":1922},{},[1923],{"type":49,"value":1924},"Merge a stack by number",{"type":44,"tag":1451,"props":1926,"children":1927},{},[1928],{"type":44,"tag":55,"props":1929,"children":1931},{"className":1930},[],[1932],{"type":49,"value":778},{"type":44,"tag":1429,"props":1934,"children":1935},{},[1936,1941],{"type":44,"tag":1451,"props":1937,"children":1938},{},[1939],{"type":49,"value":1940},"Merge up to a specific PR",{"type":44,"tag":1451,"props":1942,"children":1943},{},[1944],{"type":44,"tag":55,"props":1945,"children":1947},{"className":1946},[],[1948],{"type":49,"value":770},{"type":44,"tag":1429,"props":1950,"children":1951},{},[1952,1957],{"type":44,"tag":1451,"props":1953,"children":1954},{},[1955],{"type":49,"value":1956},"Merge with a specific method",{"type":44,"tag":1451,"props":1958,"children":1959},{},[1960],{"type":44,"tag":55,"props":1961,"children":1963},{"className":1962},[],[1964],{"type":49,"value":1965},"gh stack merge --yes --squash",{"type":44,"tag":1967,"props":1968,"children":1969},"hr",{},[],{"type":44,"tag":156,"props":1971,"children":1973},{"id":1972},"workflows",[1974],{"type":49,"value":1975},"Workflows",{"type":44,"tag":943,"props":1977,"children":1979},{"id":1978},"end-to-end-create-a-stack-from-scratch",[1980],{"type":49,"value":1981},"End-to-end: create a stack from scratch",{"type":44,"tag":83,"props":1983,"children":1985},{"className":218,"code":1984,"language":220,"meta":91,"style":91},"# 1. Initialize a stack with the first branch\ngh stack init auth\n# → creates auth and checks it out\n\n# 2. Write code for the first layer (auth)\ncat > auth.go \u003C\u003C 'EOF'\npackage auth\n\nfunc Middleware(next http.Handler) http.Handler {\n    return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n        \u002F\u002F verify token\n        next.ServeHTTP(w, r)\n    })\n}\nEOF\n\n# 3. Stage and commit using standard git commands\ngit add auth.go\ngit commit -m \"Add auth middleware\"\n\n# You can make multiple commits on the same branch\ncat > auth_test.go \u003C\u003C 'EOF'\npackage auth\n\nfunc TestMiddleware(t *testing.T) {\n    \u002F\u002F test auth middleware\n}\nEOF\ngit add auth_test.go\ngit commit -m \"Add auth middleware tests\"\n\n# 4. When you're ready for a new concern, add the next branch\ngh stack add api-routes\n# → creates api-routes\n\n# 5. Write code for the API layer\ncat > api.go \u003C\u003C 'EOF'\npackage api\n\nfunc RegisterRoutes(mux *http.ServeMux) {\n    mux.HandleFunc(\"\u002Fusers\", handleUsers)\n}\nEOF\ngit add api.go\ngit commit -m \"Add API routes\"\n\n# 6. Add a third layer for frontend\ngh stack add frontend\n# → creates frontend\n\ncat > frontend.go \u003C\u003C 'EOF'\npackage frontend\n\nfunc RenderDashboard(w http.ResponseWriter) {\n    \u002F\u002F calls the API endpoints from the layer below\n}\nEOF\ngit add frontend.go\ngit commit -m \"Add frontend dashboard\"\n\n# ── Stack complete: auth → api-routes → frontend ──\n\n# 7. Push everything and create PRs (drafts by default)\ngh stack submit --auto\n\n# 8. Verify the stack\ngh stack view --json\n",[1986],{"type":44,"tag":55,"props":1987,"children":1988},{"__ignoreMap":91},[1989,1997,2018,2026,2033,2041,2069,2077,2084,2092,2100,2108,2116,2125,2134,2143,2151,2159,2176,2205,2213,2222,2247,2255,2263,2272,2281,2289,2297,2314,2343,2351,2360,2381,2390,2398,2407,2432,2441,2449,2458,2467,2475,2483,2500,2529,2537,2546,2567,2576,2584,2609,2618,2626,2635,2644,2652,2660,2677,2706,2714,2723,2731,2740,2762,2770,2779],{"type":44,"tag":226,"props":1990,"children":1991},{"class":228,"line":229},[1992],{"type":44,"tag":226,"props":1993,"children":1994},{"style":296},[1995],{"type":49,"value":1996},"# 1. Initialize a stack with the first branch\n",{"type":44,"tag":226,"props":1998,"children":1999},{"class":228,"line":302},[2000,2004,2008,2013],{"type":44,"tag":226,"props":2001,"children":2002},{"style":233},[2003],{"type":49,"value":213},{"type":44,"tag":226,"props":2005,"children":2006},{"style":238},[2007],{"type":49,"value":1238},{"type":44,"tag":226,"props":2009,"children":2010},{"style":238},[2011],{"type":49,"value":2012}," init",{"type":44,"tag":226,"props":2014,"children":2015},{"style":238},[2016],{"type":49,"value":2017}," auth\n",{"type":44,"tag":226,"props":2019,"children":2020},{"class":228,"line":1099},[2021],{"type":44,"tag":226,"props":2022,"children":2023},{"style":296},[2024],{"type":49,"value":2025},"# → creates auth and checks it out\n",{"type":44,"tag":226,"props":2027,"children":2028},{"class":228,"line":1122},[2029],{"type":44,"tag":226,"props":2030,"children":2031},{"emptyLinePlaceholder":1159},[2032],{"type":49,"value":1162},{"type":44,"tag":226,"props":2034,"children":2035},{"class":228,"line":1155},[2036],{"type":44,"tag":226,"props":2037,"children":2038},{"style":296},[2039],{"type":49,"value":2040},"# 2. Write code for the first layer (auth)\n",{"type":44,"tag":226,"props":2042,"children":2043},{"class":228,"line":1165},[2044,2049,2054,2059,2064],{"type":44,"tag":226,"props":2045,"children":2046},{"style":233},[2047],{"type":49,"value":2048},"cat",{"type":44,"tag":226,"props":2050,"children":2051},{"style":290},[2052],{"type":49,"value":2053}," >",{"type":44,"tag":226,"props":2055,"children":2056},{"style":238},[2057],{"type":49,"value":2058}," auth.go",{"type":44,"tag":226,"props":2060,"children":2061},{"style":290},[2062],{"type":49,"value":2063}," \u003C\u003C",{"type":44,"tag":226,"props":2065,"children":2066},{"style":290},[2067],{"type":49,"value":2068}," 'EOF'\n",{"type":44,"tag":226,"props":2070,"children":2071},{"class":228,"line":1182},[2072],{"type":44,"tag":226,"props":2073,"children":2074},{"style":238},[2075],{"type":49,"value":2076},"package auth\n",{"type":44,"tag":226,"props":2078,"children":2079},{"class":228,"line":1211},[2080],{"type":44,"tag":226,"props":2081,"children":2082},{"emptyLinePlaceholder":1159},[2083],{"type":49,"value":1162},{"type":44,"tag":226,"props":2085,"children":2086},{"class":228,"line":1219},[2087],{"type":44,"tag":226,"props":2088,"children":2089},{"style":238},[2090],{"type":49,"value":2091},"func Middleware(next http.Handler) http.Handler {\n",{"type":44,"tag":226,"props":2093,"children":2094},{"class":228,"line":1228},[2095],{"type":44,"tag":226,"props":2096,"children":2097},{"style":238},[2098],{"type":49,"value":2099},"    return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n",{"type":44,"tag":226,"props":2101,"children":2102},{"class":228,"line":1255},[2103],{"type":44,"tag":226,"props":2104,"children":2105},{"style":238},[2106],{"type":49,"value":2107},"        \u002F\u002F verify token\n",{"type":44,"tag":226,"props":2109,"children":2110},{"class":228,"line":1277},[2111],{"type":44,"tag":226,"props":2112,"children":2113},{"style":238},[2114],{"type":49,"value":2115},"        next.ServeHTTP(w, r)\n",{"type":44,"tag":226,"props":2117,"children":2119},{"class":228,"line":2118},13,[2120],{"type":44,"tag":226,"props":2121,"children":2122},{"style":238},[2123],{"type":49,"value":2124},"    })\n",{"type":44,"tag":226,"props":2126,"children":2128},{"class":228,"line":2127},14,[2129],{"type":44,"tag":226,"props":2130,"children":2131},{"style":238},[2132],{"type":49,"value":2133},"}\n",{"type":44,"tag":226,"props":2135,"children":2137},{"class":228,"line":2136},15,[2138],{"type":44,"tag":226,"props":2139,"children":2140},{"style":290},[2141],{"type":49,"value":2142},"EOF\n",{"type":44,"tag":226,"props":2144,"children":2146},{"class":228,"line":2145},16,[2147],{"type":44,"tag":226,"props":2148,"children":2149},{"emptyLinePlaceholder":1159},[2150],{"type":49,"value":1162},{"type":44,"tag":226,"props":2152,"children":2153},{"class":228,"line":27},[2154],{"type":44,"tag":226,"props":2155,"children":2156},{"style":296},[2157],{"type":49,"value":2158},"# 3. Stage and commit using standard git commands\n",{"type":44,"tag":226,"props":2160,"children":2162},{"class":228,"line":2161},18,[2163,2167,2171],{"type":44,"tag":226,"props":2164,"children":2165},{"style":233},[2166],{"type":49,"value":19},{"type":44,"tag":226,"props":2168,"children":2169},{"style":238},[2170],{"type":49,"value":1109},{"type":44,"tag":226,"props":2172,"children":2173},{"style":238},[2174],{"type":49,"value":2175}," auth.go\n",{"type":44,"tag":226,"props":2177,"children":2179},{"class":228,"line":2178},19,[2180,2184,2188,2192,2196,2201],{"type":44,"tag":226,"props":2181,"children":2182},{"style":233},[2183],{"type":49,"value":19},{"type":44,"tag":226,"props":2185,"children":2186},{"style":238},[2187],{"type":49,"value":1132},{"type":44,"tag":226,"props":2189,"children":2190},{"style":238},[2191],{"type":49,"value":1137},{"type":44,"tag":226,"props":2193,"children":2194},{"style":290},[2195],{"type":49,"value":1142},{"type":44,"tag":226,"props":2197,"children":2198},{"style":238},[2199],{"type":49,"value":2200},"Add auth middleware",{"type":44,"tag":226,"props":2202,"children":2203},{"style":290},[2204],{"type":49,"value":1152},{"type":44,"tag":226,"props":2206,"children":2208},{"class":228,"line":2207},20,[2209],{"type":44,"tag":226,"props":2210,"children":2211},{"emptyLinePlaceholder":1159},[2212],{"type":49,"value":1162},{"type":44,"tag":226,"props":2214,"children":2216},{"class":228,"line":2215},21,[2217],{"type":44,"tag":226,"props":2218,"children":2219},{"style":296},[2220],{"type":49,"value":2221},"# You can make multiple commits on the same branch\n",{"type":44,"tag":226,"props":2223,"children":2225},{"class":228,"line":2224},22,[2226,2230,2234,2239,2243],{"type":44,"tag":226,"props":2227,"children":2228},{"style":233},[2229],{"type":49,"value":2048},{"type":44,"tag":226,"props":2231,"children":2232},{"style":290},[2233],{"type":49,"value":2053},{"type":44,"tag":226,"props":2235,"children":2236},{"style":238},[2237],{"type":49,"value":2238}," auth_test.go",{"type":44,"tag":226,"props":2240,"children":2241},{"style":290},[2242],{"type":49,"value":2063},{"type":44,"tag":226,"props":2244,"children":2245},{"style":290},[2246],{"type":49,"value":2068},{"type":44,"tag":226,"props":2248,"children":2250},{"class":228,"line":2249},23,[2251],{"type":44,"tag":226,"props":2252,"children":2253},{"style":238},[2254],{"type":49,"value":2076},{"type":44,"tag":226,"props":2256,"children":2258},{"class":228,"line":2257},24,[2259],{"type":44,"tag":226,"props":2260,"children":2261},{"emptyLinePlaceholder":1159},[2262],{"type":49,"value":1162},{"type":44,"tag":226,"props":2264,"children":2266},{"class":228,"line":2265},25,[2267],{"type":44,"tag":226,"props":2268,"children":2269},{"style":238},[2270],{"type":49,"value":2271},"func TestMiddleware(t *testing.T) {\n",{"type":44,"tag":226,"props":2273,"children":2275},{"class":228,"line":2274},26,[2276],{"type":44,"tag":226,"props":2277,"children":2278},{"style":238},[2279],{"type":49,"value":2280},"    \u002F\u002F test auth middleware\n",{"type":44,"tag":226,"props":2282,"children":2284},{"class":228,"line":2283},27,[2285],{"type":44,"tag":226,"props":2286,"children":2287},{"style":238},[2288],{"type":49,"value":2133},{"type":44,"tag":226,"props":2290,"children":2292},{"class":228,"line":2291},28,[2293],{"type":44,"tag":226,"props":2294,"children":2295},{"style":290},[2296],{"type":49,"value":2142},{"type":44,"tag":226,"props":2298,"children":2300},{"class":228,"line":2299},29,[2301,2305,2309],{"type":44,"tag":226,"props":2302,"children":2303},{"style":233},[2304],{"type":49,"value":19},{"type":44,"tag":226,"props":2306,"children":2307},{"style":238},[2308],{"type":49,"value":1109},{"type":44,"tag":226,"props":2310,"children":2311},{"style":238},[2312],{"type":49,"value":2313}," auth_test.go\n",{"type":44,"tag":226,"props":2315,"children":2317},{"class":228,"line":2316},30,[2318,2322,2326,2330,2334,2339],{"type":44,"tag":226,"props":2319,"children":2320},{"style":233},[2321],{"type":49,"value":19},{"type":44,"tag":226,"props":2323,"children":2324},{"style":238},[2325],{"type":49,"value":1132},{"type":44,"tag":226,"props":2327,"children":2328},{"style":238},[2329],{"type":49,"value":1137},{"type":44,"tag":226,"props":2331,"children":2332},{"style":290},[2333],{"type":49,"value":1142},{"type":44,"tag":226,"props":2335,"children":2336},{"style":238},[2337],{"type":49,"value":2338},"Add auth middleware tests",{"type":44,"tag":226,"props":2340,"children":2341},{"style":290},[2342],{"type":49,"value":1152},{"type":44,"tag":226,"props":2344,"children":2346},{"class":228,"line":2345},31,[2347],{"type":44,"tag":226,"props":2348,"children":2349},{"emptyLinePlaceholder":1159},[2350],{"type":49,"value":1162},{"type":44,"tag":226,"props":2352,"children":2354},{"class":228,"line":2353},32,[2355],{"type":44,"tag":226,"props":2356,"children":2357},{"style":296},[2358],{"type":49,"value":2359},"# 4. When you're ready for a new concern, add the next branch\n",{"type":44,"tag":226,"props":2361,"children":2363},{"class":228,"line":2362},33,[2364,2368,2372,2376],{"type":44,"tag":226,"props":2365,"children":2366},{"style":233},[2367],{"type":49,"value":213},{"type":44,"tag":226,"props":2369,"children":2370},{"style":238},[2371],{"type":49,"value":1238},{"type":44,"tag":226,"props":2373,"children":2374},{"style":238},[2375],{"type":49,"value":1109},{"type":44,"tag":226,"props":2377,"children":2378},{"style":238},[2379],{"type":49,"value":2380}," api-routes\n",{"type":44,"tag":226,"props":2382,"children":2384},{"class":228,"line":2383},34,[2385],{"type":44,"tag":226,"props":2386,"children":2387},{"style":296},[2388],{"type":49,"value":2389},"# → creates api-routes\n",{"type":44,"tag":226,"props":2391,"children":2393},{"class":228,"line":2392},35,[2394],{"type":44,"tag":226,"props":2395,"children":2396},{"emptyLinePlaceholder":1159},[2397],{"type":49,"value":1162},{"type":44,"tag":226,"props":2399,"children":2401},{"class":228,"line":2400},36,[2402],{"type":44,"tag":226,"props":2403,"children":2404},{"style":296},[2405],{"type":49,"value":2406},"# 5. Write code for the API layer\n",{"type":44,"tag":226,"props":2408,"children":2410},{"class":228,"line":2409},37,[2411,2415,2419,2424,2428],{"type":44,"tag":226,"props":2412,"children":2413},{"style":233},[2414],{"type":49,"value":2048},{"type":44,"tag":226,"props":2416,"children":2417},{"style":290},[2418],{"type":49,"value":2053},{"type":44,"tag":226,"props":2420,"children":2421},{"style":238},[2422],{"type":49,"value":2423}," api.go",{"type":44,"tag":226,"props":2425,"children":2426},{"style":290},[2427],{"type":49,"value":2063},{"type":44,"tag":226,"props":2429,"children":2430},{"style":290},[2431],{"type":49,"value":2068},{"type":44,"tag":226,"props":2433,"children":2435},{"class":228,"line":2434},38,[2436],{"type":44,"tag":226,"props":2437,"children":2438},{"style":238},[2439],{"type":49,"value":2440},"package api\n",{"type":44,"tag":226,"props":2442,"children":2444},{"class":228,"line":2443},39,[2445],{"type":44,"tag":226,"props":2446,"children":2447},{"emptyLinePlaceholder":1159},[2448],{"type":49,"value":1162},{"type":44,"tag":226,"props":2450,"children":2452},{"class":228,"line":2451},40,[2453],{"type":44,"tag":226,"props":2454,"children":2455},{"style":238},[2456],{"type":49,"value":2457},"func RegisterRoutes(mux *http.ServeMux) {\n",{"type":44,"tag":226,"props":2459,"children":2461},{"class":228,"line":2460},41,[2462],{"type":44,"tag":226,"props":2463,"children":2464},{"style":238},[2465],{"type":49,"value":2466},"    mux.HandleFunc(\"\u002Fusers\", handleUsers)\n",{"type":44,"tag":226,"props":2468,"children":2470},{"class":228,"line":2469},42,[2471],{"type":44,"tag":226,"props":2472,"children":2473},{"style":238},[2474],{"type":49,"value":2133},{"type":44,"tag":226,"props":2476,"children":2478},{"class":228,"line":2477},43,[2479],{"type":44,"tag":226,"props":2480,"children":2481},{"style":290},[2482],{"type":49,"value":2142},{"type":44,"tag":226,"props":2484,"children":2486},{"class":228,"line":2485},44,[2487,2491,2495],{"type":44,"tag":226,"props":2488,"children":2489},{"style":233},[2490],{"type":49,"value":19},{"type":44,"tag":226,"props":2492,"children":2493},{"style":238},[2494],{"type":49,"value":1109},{"type":44,"tag":226,"props":2496,"children":2497},{"style":238},[2498],{"type":49,"value":2499}," api.go\n",{"type":44,"tag":226,"props":2501,"children":2503},{"class":228,"line":2502},45,[2504,2508,2512,2516,2520,2525],{"type":44,"tag":226,"props":2505,"children":2506},{"style":233},[2507],{"type":49,"value":19},{"type":44,"tag":226,"props":2509,"children":2510},{"style":238},[2511],{"type":49,"value":1132},{"type":44,"tag":226,"props":2513,"children":2514},{"style":238},[2515],{"type":49,"value":1137},{"type":44,"tag":226,"props":2517,"children":2518},{"style":290},[2519],{"type":49,"value":1142},{"type":44,"tag":226,"props":2521,"children":2522},{"style":238},[2523],{"type":49,"value":2524},"Add API routes",{"type":44,"tag":226,"props":2526,"children":2527},{"style":290},[2528],{"type":49,"value":1152},{"type":44,"tag":226,"props":2530,"children":2532},{"class":228,"line":2531},46,[2533],{"type":44,"tag":226,"props":2534,"children":2535},{"emptyLinePlaceholder":1159},[2536],{"type":49,"value":1162},{"type":44,"tag":226,"props":2538,"children":2540},{"class":228,"line":2539},47,[2541],{"type":44,"tag":226,"props":2542,"children":2543},{"style":296},[2544],{"type":49,"value":2545},"# 6. Add a third layer for frontend\n",{"type":44,"tag":226,"props":2547,"children":2549},{"class":228,"line":2548},48,[2550,2554,2558,2562],{"type":44,"tag":226,"props":2551,"children":2552},{"style":233},[2553],{"type":49,"value":213},{"type":44,"tag":226,"props":2555,"children":2556},{"style":238},[2557],{"type":49,"value":1238},{"type":44,"tag":226,"props":2559,"children":2560},{"style":238},[2561],{"type":49,"value":1109},{"type":44,"tag":226,"props":2563,"children":2564},{"style":238},[2565],{"type":49,"value":2566}," frontend\n",{"type":44,"tag":226,"props":2568,"children":2570},{"class":228,"line":2569},49,[2571],{"type":44,"tag":226,"props":2572,"children":2573},{"style":296},[2574],{"type":49,"value":2575},"# → creates frontend\n",{"type":44,"tag":226,"props":2577,"children":2579},{"class":228,"line":2578},50,[2580],{"type":44,"tag":226,"props":2581,"children":2582},{"emptyLinePlaceholder":1159},[2583],{"type":49,"value":1162},{"type":44,"tag":226,"props":2585,"children":2587},{"class":228,"line":2586},51,[2588,2592,2596,2601,2605],{"type":44,"tag":226,"props":2589,"children":2590},{"style":233},[2591],{"type":49,"value":2048},{"type":44,"tag":226,"props":2593,"children":2594},{"style":290},[2595],{"type":49,"value":2053},{"type":44,"tag":226,"props":2597,"children":2598},{"style":238},[2599],{"type":49,"value":2600}," frontend.go",{"type":44,"tag":226,"props":2602,"children":2603},{"style":290},[2604],{"type":49,"value":2063},{"type":44,"tag":226,"props":2606,"children":2607},{"style":290},[2608],{"type":49,"value":2068},{"type":44,"tag":226,"props":2610,"children":2612},{"class":228,"line":2611},52,[2613],{"type":44,"tag":226,"props":2614,"children":2615},{"style":238},[2616],{"type":49,"value":2617},"package frontend\n",{"type":44,"tag":226,"props":2619,"children":2621},{"class":228,"line":2620},53,[2622],{"type":44,"tag":226,"props":2623,"children":2624},{"emptyLinePlaceholder":1159},[2625],{"type":49,"value":1162},{"type":44,"tag":226,"props":2627,"children":2629},{"class":228,"line":2628},54,[2630],{"type":44,"tag":226,"props":2631,"children":2632},{"style":238},[2633],{"type":49,"value":2634},"func RenderDashboard(w http.ResponseWriter) {\n",{"type":44,"tag":226,"props":2636,"children":2638},{"class":228,"line":2637},55,[2639],{"type":44,"tag":226,"props":2640,"children":2641},{"style":238},[2642],{"type":49,"value":2643},"    \u002F\u002F calls the API endpoints from the layer below\n",{"type":44,"tag":226,"props":2645,"children":2647},{"class":228,"line":2646},56,[2648],{"type":44,"tag":226,"props":2649,"children":2650},{"style":238},[2651],{"type":49,"value":2133},{"type":44,"tag":226,"props":2653,"children":2655},{"class":228,"line":2654},57,[2656],{"type":44,"tag":226,"props":2657,"children":2658},{"style":290},[2659],{"type":49,"value":2142},{"type":44,"tag":226,"props":2661,"children":2663},{"class":228,"line":2662},58,[2664,2668,2672],{"type":44,"tag":226,"props":2665,"children":2666},{"style":233},[2667],{"type":49,"value":19},{"type":44,"tag":226,"props":2669,"children":2670},{"style":238},[2671],{"type":49,"value":1109},{"type":44,"tag":226,"props":2673,"children":2674},{"style":238},[2675],{"type":49,"value":2676}," frontend.go\n",{"type":44,"tag":226,"props":2678,"children":2680},{"class":228,"line":2679},59,[2681,2685,2689,2693,2697,2702],{"type":44,"tag":226,"props":2682,"children":2683},{"style":233},[2684],{"type":49,"value":19},{"type":44,"tag":226,"props":2686,"children":2687},{"style":238},[2688],{"type":49,"value":1132},{"type":44,"tag":226,"props":2690,"children":2691},{"style":238},[2692],{"type":49,"value":1137},{"type":44,"tag":226,"props":2694,"children":2695},{"style":290},[2696],{"type":49,"value":1142},{"type":44,"tag":226,"props":2698,"children":2699},{"style":238},[2700],{"type":49,"value":2701},"Add frontend dashboard",{"type":44,"tag":226,"props":2703,"children":2704},{"style":290},[2705],{"type":49,"value":1152},{"type":44,"tag":226,"props":2707,"children":2709},{"class":228,"line":2708},60,[2710],{"type":44,"tag":226,"props":2711,"children":2712},{"emptyLinePlaceholder":1159},[2713],{"type":49,"value":1162},{"type":44,"tag":226,"props":2715,"children":2717},{"class":228,"line":2716},61,[2718],{"type":44,"tag":226,"props":2719,"children":2720},{"style":296},[2721],{"type":49,"value":2722},"# ── Stack complete: auth → api-routes → frontend ──\n",{"type":44,"tag":226,"props":2724,"children":2726},{"class":228,"line":2725},62,[2727],{"type":44,"tag":226,"props":2728,"children":2729},{"emptyLinePlaceholder":1159},[2730],{"type":49,"value":1162},{"type":44,"tag":226,"props":2732,"children":2734},{"class":228,"line":2733},63,[2735],{"type":44,"tag":226,"props":2736,"children":2737},{"style":296},[2738],{"type":49,"value":2739},"# 7. Push everything and create PRs (drafts by default)\n",{"type":44,"tag":226,"props":2741,"children":2743},{"class":228,"line":2742},64,[2744,2748,2752,2757],{"type":44,"tag":226,"props":2745,"children":2746},{"style":233},[2747],{"type":49,"value":213},{"type":44,"tag":226,"props":2749,"children":2750},{"style":238},[2751],{"type":49,"value":1238},{"type":44,"tag":226,"props":2753,"children":2754},{"style":238},[2755],{"type":49,"value":2756}," submit",{"type":44,"tag":226,"props":2758,"children":2759},{"style":238},[2760],{"type":49,"value":2761}," --auto\n",{"type":44,"tag":226,"props":2763,"children":2765},{"class":228,"line":2764},65,[2766],{"type":44,"tag":226,"props":2767,"children":2768},{"emptyLinePlaceholder":1159},[2769],{"type":49,"value":1162},{"type":44,"tag":226,"props":2771,"children":2773},{"class":228,"line":2772},66,[2774],{"type":44,"tag":226,"props":2775,"children":2776},{"style":296},[2777],{"type":49,"value":2778},"# 8. Verify the stack\n",{"type":44,"tag":226,"props":2780,"children":2782},{"class":228,"line":2781},67,[2783,2787,2791,2796],{"type":44,"tag":226,"props":2784,"children":2785},{"style":233},[2786],{"type":49,"value":213},{"type":44,"tag":226,"props":2788,"children":2789},{"style":238},[2790],{"type":49,"value":1238},{"type":44,"tag":226,"props":2792,"children":2793},{"style":238},[2794],{"type":49,"value":2795}," view",{"type":44,"tag":226,"props":2797,"children":2798},{"style":238},[2799],{"type":49,"value":2800}," --json\n",{"type":44,"tag":2802,"props":2803,"children":2804},"blockquote",{},[2805],{"type":44,"tag":51,"props":2806,"children":2807},{},[2808,2813,2815,2821],{"type":44,"tag":75,"props":2809,"children":2810},{},[2811],{"type":49,"value":2812},"Shortcut:",{"type":49,"value":2814}," If you prefer a faster flow, ",{"type":44,"tag":55,"props":2816,"children":2818},{"className":2817},[],[2819],{"type":49,"value":2820},"gh stack add -Am \"message\" branch-name",{"type":49,"value":2822}," combines staging, committing, and branch creation into one command. This is useful for single-commit layers but bypasses deliberate staging.",{"type":44,"tag":943,"props":2824,"children":2826},{"id":2825},"making-mid-stack-changes",[2827],{"type":49,"value":2828},"Making mid-stack changes",{"type":44,"tag":51,"props":2830,"children":2831},{},[2832,2834,2839],{"type":49,"value":2833},"This is a critical workflow for agents. When you're working on a higher layer and realize you need to change something in a lower layer (e.g., you're building frontend components but need to add an API endpoint), ",{"type":44,"tag":75,"props":2835,"children":2836},{},[2837],{"type":49,"value":2838},"navigate down to the correct branch, make the change there, and rebase",{"type":49,"value":402},{"type":44,"tag":83,"props":2841,"children":2843},{"className":218,"code":2842,"language":220,"meta":91,"style":91},"# You're on frontend but need to add an API endpoint\n\n# 1. Navigate to the API branch\ngh stack down\n# or: gh stack checkout api-routes\n\n# 2. Make the change where it belongs\ncat > users_api.go \u003C\u003C 'EOF'\npackage api\n\nfunc handleGetUser(w http.ResponseWriter, r *http.Request) {\n    \u002F\u002F new endpoint the frontend needs\n}\nEOF\ngit add users_api.go\ngit commit -m \"Add get-user endpoint\"\n\n# 3. Rebase everything above to pick up the change\ngh stack rebase --upstack\n\n# 4. Navigate back to where you were working\ngh stack top\n# or: gh stack checkout frontend\n\n# 5. Continue working — the API changes are now available\n",[2844],{"type":44,"tag":55,"props":2845,"children":2846},{"__ignoreMap":91},[2847,2855,2862,2870,2886,2894,2901,2909,2933,2940,2947,2955,2963,2970,2977,2993,3021,3028,3036,3057,3064,3072,3088,3096,3103],{"type":44,"tag":226,"props":2848,"children":2849},{"class":228,"line":229},[2850],{"type":44,"tag":226,"props":2851,"children":2852},{"style":296},[2853],{"type":49,"value":2854},"# You're on frontend but need to add an API endpoint\n",{"type":44,"tag":226,"props":2856,"children":2857},{"class":228,"line":302},[2858],{"type":44,"tag":226,"props":2859,"children":2860},{"emptyLinePlaceholder":1159},[2861],{"type":49,"value":1162},{"type":44,"tag":226,"props":2863,"children":2864},{"class":228,"line":1099},[2865],{"type":44,"tag":226,"props":2866,"children":2867},{"style":296},[2868],{"type":49,"value":2869},"# 1. Navigate to the API branch\n",{"type":44,"tag":226,"props":2871,"children":2872},{"class":228,"line":1122},[2873,2877,2881],{"type":44,"tag":226,"props":2874,"children":2875},{"style":233},[2876],{"type":49,"value":213},{"type":44,"tag":226,"props":2878,"children":2879},{"style":238},[2880],{"type":49,"value":1238},{"type":44,"tag":226,"props":2882,"children":2883},{"style":238},[2884],{"type":49,"value":2885}," down\n",{"type":44,"tag":226,"props":2887,"children":2888},{"class":228,"line":1155},[2889],{"type":44,"tag":226,"props":2890,"children":2891},{"style":296},[2892],{"type":49,"value":2893},"# or: gh stack checkout api-routes\n",{"type":44,"tag":226,"props":2895,"children":2896},{"class":228,"line":1165},[2897],{"type":44,"tag":226,"props":2898,"children":2899},{"emptyLinePlaceholder":1159},[2900],{"type":49,"value":1162},{"type":44,"tag":226,"props":2902,"children":2903},{"class":228,"line":1182},[2904],{"type":44,"tag":226,"props":2905,"children":2906},{"style":296},[2907],{"type":49,"value":2908},"# 2. Make the change where it belongs\n",{"type":44,"tag":226,"props":2910,"children":2911},{"class":228,"line":1211},[2912,2916,2920,2925,2929],{"type":44,"tag":226,"props":2913,"children":2914},{"style":233},[2915],{"type":49,"value":2048},{"type":44,"tag":226,"props":2917,"children":2918},{"style":290},[2919],{"type":49,"value":2053},{"type":44,"tag":226,"props":2921,"children":2922},{"style":238},[2923],{"type":49,"value":2924}," users_api.go",{"type":44,"tag":226,"props":2926,"children":2927},{"style":290},[2928],{"type":49,"value":2063},{"type":44,"tag":226,"props":2930,"children":2931},{"style":290},[2932],{"type":49,"value":2068},{"type":44,"tag":226,"props":2934,"children":2935},{"class":228,"line":1219},[2936],{"type":44,"tag":226,"props":2937,"children":2938},{"style":238},[2939],{"type":49,"value":2440},{"type":44,"tag":226,"props":2941,"children":2942},{"class":228,"line":1228},[2943],{"type":44,"tag":226,"props":2944,"children":2945},{"emptyLinePlaceholder":1159},[2946],{"type":49,"value":1162},{"type":44,"tag":226,"props":2948,"children":2949},{"class":228,"line":1255},[2950],{"type":44,"tag":226,"props":2951,"children":2952},{"style":238},[2953],{"type":49,"value":2954},"func handleGetUser(w http.ResponseWriter, r *http.Request) {\n",{"type":44,"tag":226,"props":2956,"children":2957},{"class":228,"line":1277},[2958],{"type":44,"tag":226,"props":2959,"children":2960},{"style":238},[2961],{"type":49,"value":2962},"    \u002F\u002F new endpoint the frontend needs\n",{"type":44,"tag":226,"props":2964,"children":2965},{"class":228,"line":2118},[2966],{"type":44,"tag":226,"props":2967,"children":2968},{"style":238},[2969],{"type":49,"value":2133},{"type":44,"tag":226,"props":2971,"children":2972},{"class":228,"line":2127},[2973],{"type":44,"tag":226,"props":2974,"children":2975},{"style":290},[2976],{"type":49,"value":2142},{"type":44,"tag":226,"props":2978,"children":2979},{"class":228,"line":2136},[2980,2984,2988],{"type":44,"tag":226,"props":2981,"children":2982},{"style":233},[2983],{"type":49,"value":19},{"type":44,"tag":226,"props":2985,"children":2986},{"style":238},[2987],{"type":49,"value":1109},{"type":44,"tag":226,"props":2989,"children":2990},{"style":238},[2991],{"type":49,"value":2992}," users_api.go\n",{"type":44,"tag":226,"props":2994,"children":2995},{"class":228,"line":2145},[2996,3000,3004,3008,3012,3017],{"type":44,"tag":226,"props":2997,"children":2998},{"style":233},[2999],{"type":49,"value":19},{"type":44,"tag":226,"props":3001,"children":3002},{"style":238},[3003],{"type":49,"value":1132},{"type":44,"tag":226,"props":3005,"children":3006},{"style":238},[3007],{"type":49,"value":1137},{"type":44,"tag":226,"props":3009,"children":3010},{"style":290},[3011],{"type":49,"value":1142},{"type":44,"tag":226,"props":3013,"children":3014},{"style":238},[3015],{"type":49,"value":3016},"Add get-user endpoint",{"type":44,"tag":226,"props":3018,"children":3019},{"style":290},[3020],{"type":49,"value":1152},{"type":44,"tag":226,"props":3022,"children":3023},{"class":228,"line":27},[3024],{"type":44,"tag":226,"props":3025,"children":3026},{"emptyLinePlaceholder":1159},[3027],{"type":49,"value":1162},{"type":44,"tag":226,"props":3029,"children":3030},{"class":228,"line":2161},[3031],{"type":44,"tag":226,"props":3032,"children":3033},{"style":296},[3034],{"type":49,"value":3035},"# 3. Rebase everything above to pick up the change\n",{"type":44,"tag":226,"props":3037,"children":3038},{"class":228,"line":2178},[3039,3043,3047,3052],{"type":44,"tag":226,"props":3040,"children":3041},{"style":233},[3042],{"type":49,"value":213},{"type":44,"tag":226,"props":3044,"children":3045},{"style":238},[3046],{"type":49,"value":1238},{"type":44,"tag":226,"props":3048,"children":3049},{"style":238},[3050],{"type":49,"value":3051}," rebase",{"type":44,"tag":226,"props":3053,"children":3054},{"style":238},[3055],{"type":49,"value":3056}," --upstack\n",{"type":44,"tag":226,"props":3058,"children":3059},{"class":228,"line":2207},[3060],{"type":44,"tag":226,"props":3061,"children":3062},{"emptyLinePlaceholder":1159},[3063],{"type":49,"value":1162},{"type":44,"tag":226,"props":3065,"children":3066},{"class":228,"line":2215},[3067],{"type":44,"tag":226,"props":3068,"children":3069},{"style":296},[3070],{"type":49,"value":3071},"# 4. Navigate back to where you were working\n",{"type":44,"tag":226,"props":3073,"children":3074},{"class":228,"line":2224},[3075,3079,3083],{"type":44,"tag":226,"props":3076,"children":3077},{"style":233},[3078],{"type":49,"value":213},{"type":44,"tag":226,"props":3080,"children":3081},{"style":238},[3082],{"type":49,"value":1238},{"type":44,"tag":226,"props":3084,"children":3085},{"style":238},[3086],{"type":49,"value":3087}," top\n",{"type":44,"tag":226,"props":3089,"children":3090},{"class":228,"line":2249},[3091],{"type":44,"tag":226,"props":3092,"children":3093},{"style":296},[3094],{"type":49,"value":3095},"# or: gh stack checkout frontend\n",{"type":44,"tag":226,"props":3097,"children":3098},{"class":228,"line":2257},[3099],{"type":44,"tag":226,"props":3100,"children":3101},{"emptyLinePlaceholder":1159},[3102],{"type":49,"value":1162},{"type":44,"tag":226,"props":3104,"children":3105},{"class":228,"line":2265},[3106],{"type":44,"tag":226,"props":3107,"children":3108},{"style":296},[3109],{"type":49,"value":3110},"# 5. Continue working — the API changes are now available\n",{"type":44,"tag":51,"props":3112,"children":3113},{},[3114,3119],{"type":44,"tag":75,"props":3115,"children":3116},{},[3117],{"type":49,"value":3118},"Why this matters:",{"type":49,"value":3120}," If you make API changes on the frontend branch, those changes will end up in the wrong PR. The API PR won't include them, and the frontend PR will have unrelated API diffs mixed in. Always put changes in the branch where they logically belong.",{"type":44,"tag":943,"props":3122,"children":3124},{"id":3123},"modify-a-mid-stack-branch-and-sync",[3125],{"type":49,"value":3126},"Modify a mid-stack branch and sync",{"type":44,"tag":51,"props":3128,"children":3129},{},[3130],{"type":49,"value":3131},"When you need to revisit a branch after the initial creation (e.g., responding to review feedback):",{"type":44,"tag":83,"props":3133,"children":3135},{"className":218,"code":3134,"language":220,"meta":91,"style":91},"# 1. Navigate to the branch that needs changes\ngh stack bottom\n# or: gh stack checkout auth\n# or: gh stack checkout 42  (by PR number)\n\n# 2. Make changes and commit\ncat > auth.go \u003C\u003C 'EOF'\npackage auth\n\u002F\u002F updated implementation\nEOF\ngit add auth.go\ngit commit -m \"Fix auth token validation\"\n\n# 3. Rebase everything above this branch\ngh stack rebase --upstack\n\n# 4. Push the updated stack\ngh stack push\n",[3136],{"type":44,"tag":55,"props":3137,"children":3138},{"__ignoreMap":91},[3139,3147,3163,3171,3179,3186,3194,3217,3224,3232,3239,3254,3282,3289,3297,3316,3323,3331],{"type":44,"tag":226,"props":3140,"children":3141},{"class":228,"line":229},[3142],{"type":44,"tag":226,"props":3143,"children":3144},{"style":296},[3145],{"type":49,"value":3146},"# 1. Navigate to the branch that needs changes\n",{"type":44,"tag":226,"props":3148,"children":3149},{"class":228,"line":302},[3150,3154,3158],{"type":44,"tag":226,"props":3151,"children":3152},{"style":233},[3153],{"type":49,"value":213},{"type":44,"tag":226,"props":3155,"children":3156},{"style":238},[3157],{"type":49,"value":1238},{"type":44,"tag":226,"props":3159,"children":3160},{"style":238},[3161],{"type":49,"value":3162}," bottom\n",{"type":44,"tag":226,"props":3164,"children":3165},{"class":228,"line":1099},[3166],{"type":44,"tag":226,"props":3167,"children":3168},{"style":296},[3169],{"type":49,"value":3170},"# or: gh stack checkout auth\n",{"type":44,"tag":226,"props":3172,"children":3173},{"class":228,"line":1122},[3174],{"type":44,"tag":226,"props":3175,"children":3176},{"style":296},[3177],{"type":49,"value":3178},"# or: gh stack checkout 42  (by PR number)\n",{"type":44,"tag":226,"props":3180,"children":3181},{"class":228,"line":1155},[3182],{"type":44,"tag":226,"props":3183,"children":3184},{"emptyLinePlaceholder":1159},[3185],{"type":49,"value":1162},{"type":44,"tag":226,"props":3187,"children":3188},{"class":228,"line":1165},[3189],{"type":44,"tag":226,"props":3190,"children":3191},{"style":296},[3192],{"type":49,"value":3193},"# 2. Make changes and commit\n",{"type":44,"tag":226,"props":3195,"children":3196},{"class":228,"line":1182},[3197,3201,3205,3209,3213],{"type":44,"tag":226,"props":3198,"children":3199},{"style":233},[3200],{"type":49,"value":2048},{"type":44,"tag":226,"props":3202,"children":3203},{"style":290},[3204],{"type":49,"value":2053},{"type":44,"tag":226,"props":3206,"children":3207},{"style":238},[3208],{"type":49,"value":2058},{"type":44,"tag":226,"props":3210,"children":3211},{"style":290},[3212],{"type":49,"value":2063},{"type":44,"tag":226,"props":3214,"children":3215},{"style":290},[3216],{"type":49,"value":2068},{"type":44,"tag":226,"props":3218,"children":3219},{"class":228,"line":1211},[3220],{"type":44,"tag":226,"props":3221,"children":3222},{"style":238},[3223],{"type":49,"value":2076},{"type":44,"tag":226,"props":3225,"children":3226},{"class":228,"line":1219},[3227],{"type":44,"tag":226,"props":3228,"children":3229},{"style":238},[3230],{"type":49,"value":3231},"\u002F\u002F updated implementation\n",{"type":44,"tag":226,"props":3233,"children":3234},{"class":228,"line":1228},[3235],{"type":44,"tag":226,"props":3236,"children":3237},{"style":290},[3238],{"type":49,"value":2142},{"type":44,"tag":226,"props":3240,"children":3241},{"class":228,"line":1255},[3242,3246,3250],{"type":44,"tag":226,"props":3243,"children":3244},{"style":233},[3245],{"type":49,"value":19},{"type":44,"tag":226,"props":3247,"children":3248},{"style":238},[3249],{"type":49,"value":1109},{"type":44,"tag":226,"props":3251,"children":3252},{"style":238},[3253],{"type":49,"value":2175},{"type":44,"tag":226,"props":3255,"children":3256},{"class":228,"line":1277},[3257,3261,3265,3269,3273,3278],{"type":44,"tag":226,"props":3258,"children":3259},{"style":233},[3260],{"type":49,"value":19},{"type":44,"tag":226,"props":3262,"children":3263},{"style":238},[3264],{"type":49,"value":1132},{"type":44,"tag":226,"props":3266,"children":3267},{"style":238},[3268],{"type":49,"value":1137},{"type":44,"tag":226,"props":3270,"children":3271},{"style":290},[3272],{"type":49,"value":1142},{"type":44,"tag":226,"props":3274,"children":3275},{"style":238},[3276],{"type":49,"value":3277},"Fix auth token validation",{"type":44,"tag":226,"props":3279,"children":3280},{"style":290},[3281],{"type":49,"value":1152},{"type":44,"tag":226,"props":3283,"children":3284},{"class":228,"line":2118},[3285],{"type":44,"tag":226,"props":3286,"children":3287},{"emptyLinePlaceholder":1159},[3288],{"type":49,"value":1162},{"type":44,"tag":226,"props":3290,"children":3291},{"class":228,"line":2127},[3292],{"type":44,"tag":226,"props":3293,"children":3294},{"style":296},[3295],{"type":49,"value":3296},"# 3. Rebase everything above this branch\n",{"type":44,"tag":226,"props":3298,"children":3299},{"class":228,"line":2136},[3300,3304,3308,3312],{"type":44,"tag":226,"props":3301,"children":3302},{"style":233},[3303],{"type":49,"value":213},{"type":44,"tag":226,"props":3305,"children":3306},{"style":238},[3307],{"type":49,"value":1238},{"type":44,"tag":226,"props":3309,"children":3310},{"style":238},[3311],{"type":49,"value":3051},{"type":44,"tag":226,"props":3313,"children":3314},{"style":238},[3315],{"type":49,"value":3056},{"type":44,"tag":226,"props":3317,"children":3318},{"class":228,"line":2145},[3319],{"type":44,"tag":226,"props":3320,"children":3321},{"emptyLinePlaceholder":1159},[3322],{"type":49,"value":1162},{"type":44,"tag":226,"props":3324,"children":3325},{"class":228,"line":27},[3326],{"type":44,"tag":226,"props":3327,"children":3328},{"style":296},[3329],{"type":49,"value":3330},"# 4. Push the updated stack\n",{"type":44,"tag":226,"props":3332,"children":3333},{"class":228,"line":2161},[3334,3338,3342],{"type":44,"tag":226,"props":3335,"children":3336},{"style":233},[3337],{"type":49,"value":213},{"type":44,"tag":226,"props":3339,"children":3340},{"style":238},[3341],{"type":49,"value":1238},{"type":44,"tag":226,"props":3343,"children":3344},{"style":238},[3345],{"type":49,"value":3346}," push\n",{"type":44,"tag":943,"props":3348,"children":3350},{"id":3349},"routine-sync-after-merges",[3351],{"type":49,"value":3352},"Routine sync after merges",{"type":44,"tag":83,"props":3354,"children":3356},{"className":218,"code":3355,"language":220,"meta":91,"style":91},"# Single command: fetch, rebase, push, sync PR and stack state\ngh stack sync\n\n# Sync and automatically clean up local branches for merged PRs\ngh stack sync --prune\n",[3357],{"type":44,"tag":55,"props":3358,"children":3359},{"__ignoreMap":91},[3360,3368,3384,3391,3399],{"type":44,"tag":226,"props":3361,"children":3362},{"class":228,"line":229},[3363],{"type":44,"tag":226,"props":3364,"children":3365},{"style":296},[3366],{"type":49,"value":3367},"# Single command: fetch, rebase, push, sync PR and stack state\n",{"type":44,"tag":226,"props":3369,"children":3370},{"class":228,"line":302},[3371,3375,3379],{"type":44,"tag":226,"props":3372,"children":3373},{"style":233},[3374],{"type":49,"value":213},{"type":44,"tag":226,"props":3376,"children":3377},{"style":238},[3378],{"type":49,"value":1238},{"type":44,"tag":226,"props":3380,"children":3381},{"style":238},[3382],{"type":49,"value":3383}," sync\n",{"type":44,"tag":226,"props":3385,"children":3386},{"class":228,"line":1099},[3387],{"type":44,"tag":226,"props":3388,"children":3389},{"emptyLinePlaceholder":1159},[3390],{"type":49,"value":1162},{"type":44,"tag":226,"props":3392,"children":3393},{"class":228,"line":1122},[3394],{"type":44,"tag":226,"props":3395,"children":3396},{"style":296},[3397],{"type":49,"value":3398},"# Sync and automatically clean up local branches for merged PRs\n",{"type":44,"tag":226,"props":3400,"children":3401},{"class":228,"line":1155},[3402,3406,3410,3415],{"type":44,"tag":226,"props":3403,"children":3404},{"style":233},[3405],{"type":49,"value":213},{"type":44,"tag":226,"props":3407,"children":3408},{"style":238},[3409],{"type":49,"value":1238},{"type":44,"tag":226,"props":3411,"children":3412},{"style":238},[3413],{"type":49,"value":3414}," sync",{"type":44,"tag":226,"props":3416,"children":3417},{"style":238},[3418],{"type":49,"value":3419}," --prune\n",{"type":44,"tag":2802,"props":3421,"children":3422},{},[3423],{"type":44,"tag":51,"props":3424,"children":3425},{},[3426,3431,3433,3439],{"type":44,"tag":75,"props":3427,"children":3428},{},[3429],{"type":49,"value":3430},"Note for agents:",{"type":49,"value":3432}," In non-interactive environments, the prune prompt is not shown. Use ",{"type":44,"tag":55,"props":3434,"children":3436},{"className":3435},[],[3437],{"type":49,"value":3438},"--prune",{"type":49,"value":3440}," explicitly to delete local branches for merged PRs.",{"type":44,"tag":2802,"props":3442,"children":3443},{},[3444],{"type":44,"tag":51,"props":3445,"children":3446},{},[3447,3451,3452,3457,3459,3464,3466,3472],{"type":44,"tag":75,"props":3448,"children":3449},{},[3450],{"type":49,"value":3430},{"type":49,"value":740},{"type":44,"tag":55,"props":3453,"children":3455},{"className":3454},[],[3456],{"type":49,"value":521},{"type":49,"value":3458}," also mirrors the stack on GitHub locally. If PRs were added to the stack on github.com, their branches are pulled down and appended to the local stack automatically. If the local and remote stacks have ",{"type":44,"tag":75,"props":3460,"children":3461},{},[3462],{"type":49,"value":3463},"diverged",{"type":49,"value":3465}," (you changed the local stack while the remote stack changed differently), sync can only prompt to resolve it in an interactive terminal — in non-interactive environments it aborts the sync (nothing is pushed or updated) and exits successfully with ",{"type":44,"tag":55,"props":3467,"children":3469},{"className":3468},[],[3470],{"type":49,"value":3471},"ℹ Sync aborted",{"type":49,"value":3473},". Resolve a divergence by unstacking and recreating the stack.",{"type":44,"tag":943,"props":3475,"children":3477},{"id":3476},"squash-merge-recovery",[3478],{"type":49,"value":3479},"Squash-merge recovery",{"type":44,"tag":51,"props":3481,"children":3482},{},[3483,3485,3490,3492,3498],{"type":49,"value":3484},"When a PR is squash-merged on GitHub, the original branch's commits no longer exist in the trunk history. ",{"type":44,"tag":55,"props":3486,"children":3488},{"className":3487},[],[3489],{"type":49,"value":60},{"type":49,"value":3491}," detects this automatically and uses ",{"type":44,"tag":55,"props":3493,"children":3495},{"className":3494},[],[3496],{"type":49,"value":3497},"git rebase --onto",{"type":49,"value":3499}," to correctly replay remaining commits.",{"type":44,"tag":83,"props":3501,"children":3503},{"className":218,"code":3502,"language":220,"meta":91,"style":91},"# After PR #1 (auth) is squash-merged on GitHub:\ngh stack sync\n# → fetches latest, detects the merge, fast-forwards trunk\n# → rebases api-routes onto updated trunk (skips merged branch)\n# → rebases frontend onto api-routes\n# → pushes updated branches\n# → reports: \"Merged: #1\"\n\n# Verify the result\ngh stack view --json\n# → auth shows \"isMerged\": true, \"state\": \"MERGED\"\n# → api-routes and frontend show updated heads\n",[3504],{"type":44,"tag":55,"props":3505,"children":3506},{"__ignoreMap":91},[3507,3515,3530,3538,3546,3554,3562,3570,3577,3585,3604,3612],{"type":44,"tag":226,"props":3508,"children":3509},{"class":228,"line":229},[3510],{"type":44,"tag":226,"props":3511,"children":3512},{"style":296},[3513],{"type":49,"value":3514},"# After PR #1 (auth) is squash-merged on GitHub:\n",{"type":44,"tag":226,"props":3516,"children":3517},{"class":228,"line":302},[3518,3522,3526],{"type":44,"tag":226,"props":3519,"children":3520},{"style":233},[3521],{"type":49,"value":213},{"type":44,"tag":226,"props":3523,"children":3524},{"style":238},[3525],{"type":49,"value":1238},{"type":44,"tag":226,"props":3527,"children":3528},{"style":238},[3529],{"type":49,"value":3383},{"type":44,"tag":226,"props":3531,"children":3532},{"class":228,"line":1099},[3533],{"type":44,"tag":226,"props":3534,"children":3535},{"style":296},[3536],{"type":49,"value":3537},"# → fetches latest, detects the merge, fast-forwards trunk\n",{"type":44,"tag":226,"props":3539,"children":3540},{"class":228,"line":1122},[3541],{"type":44,"tag":226,"props":3542,"children":3543},{"style":296},[3544],{"type":49,"value":3545},"# → rebases api-routes onto updated trunk (skips merged branch)\n",{"type":44,"tag":226,"props":3547,"children":3548},{"class":228,"line":1155},[3549],{"type":44,"tag":226,"props":3550,"children":3551},{"style":296},[3552],{"type":49,"value":3553},"# → rebases frontend onto api-routes\n",{"type":44,"tag":226,"props":3555,"children":3556},{"class":228,"line":1165},[3557],{"type":44,"tag":226,"props":3558,"children":3559},{"style":296},[3560],{"type":49,"value":3561},"# → pushes updated branches\n",{"type":44,"tag":226,"props":3563,"children":3564},{"class":228,"line":1182},[3565],{"type":44,"tag":226,"props":3566,"children":3567},{"style":296},[3568],{"type":49,"value":3569},"# → reports: \"Merged: #1\"\n",{"type":44,"tag":226,"props":3571,"children":3572},{"class":228,"line":1211},[3573],{"type":44,"tag":226,"props":3574,"children":3575},{"emptyLinePlaceholder":1159},[3576],{"type":49,"value":1162},{"type":44,"tag":226,"props":3578,"children":3579},{"class":228,"line":1219},[3580],{"type":44,"tag":226,"props":3581,"children":3582},{"style":296},[3583],{"type":49,"value":3584},"# Verify the result\n",{"type":44,"tag":226,"props":3586,"children":3587},{"class":228,"line":1228},[3588,3592,3596,3600],{"type":44,"tag":226,"props":3589,"children":3590},{"style":233},[3591],{"type":49,"value":213},{"type":44,"tag":226,"props":3593,"children":3594},{"style":238},[3595],{"type":49,"value":1238},{"type":44,"tag":226,"props":3597,"children":3598},{"style":238},[3599],{"type":49,"value":2795},{"type":44,"tag":226,"props":3601,"children":3602},{"style":238},[3603],{"type":49,"value":2800},{"type":44,"tag":226,"props":3605,"children":3606},{"class":228,"line":1255},[3607],{"type":44,"tag":226,"props":3608,"children":3609},{"style":296},[3610],{"type":49,"value":3611},"# → auth shows \"isMerged\": true, \"state\": \"MERGED\"\n",{"type":44,"tag":226,"props":3613,"children":3614},{"class":228,"line":1277},[3615],{"type":44,"tag":226,"props":3616,"children":3617},{"style":296},[3618],{"type":49,"value":3619},"# → api-routes and frontend show updated heads\n",{"type":44,"tag":51,"props":3621,"children":3622},{},[3623,3625,3630,3632,3638],{"type":49,"value":3624},"If ",{"type":44,"tag":55,"props":3626,"children":3628},{"className":3627},[],[3629],{"type":49,"value":521},{"type":49,"value":3631}," hits a conflict during this process, it restores all branches to their pre-rebase state and exits with code 3. See ",{"type":44,"tag":64,"props":3633,"children":3635},{"href":3634},"#handle-rebase-conflicts-agent-workflow",[3636],{"type":49,"value":3637},"Handle rebase conflicts",{"type":49,"value":3639}," for the resolution workflow.",{"type":44,"tag":943,"props":3641,"children":3643},{"id":3642},"handle-rebase-conflicts-agent-workflow",[3644],{"type":49,"value":3645},"Handle rebase conflicts (agent workflow)",{"type":44,"tag":83,"props":3647,"children":3649},{"className":218,"code":3648,"language":220,"meta":91,"style":91},"# 1. Start the rebase\ngh stack rebase\n\n# 2. If exit code 3 (conflict):\n#    - Parse stderr for conflicted file paths\n#    - Read those files to find \u003C\u003C\u003C\u003C\u003C\u003C\u003C \u002F ======= \u002F >>>>>>> markers\n#    - Edit files to resolve conflicts\n#    - Stage resolved files:\ngit add path\u002Fto\u002Fresolved-file.go\n\n# 3. Continue the rebase\ngh stack rebase --continue\n\n# 4. If another conflict occurs, repeat steps 2-3\n\n# 5. If unable to resolve, abort to restore everything\ngh stack rebase --abort\n",[3650],{"type":44,"tag":55,"props":3651,"children":3652},{"__ignoreMap":91},[3653,3661,3677,3684,3692,3700,3708,3716,3724,3740,3747,3755,3775,3782,3790,3797,3805],{"type":44,"tag":226,"props":3654,"children":3655},{"class":228,"line":229},[3656],{"type":44,"tag":226,"props":3657,"children":3658},{"style":296},[3659],{"type":49,"value":3660},"# 1. Start the rebase\n",{"type":44,"tag":226,"props":3662,"children":3663},{"class":228,"line":302},[3664,3668,3672],{"type":44,"tag":226,"props":3665,"children":3666},{"style":233},[3667],{"type":49,"value":213},{"type":44,"tag":226,"props":3669,"children":3670},{"style":238},[3671],{"type":49,"value":1238},{"type":44,"tag":226,"props":3673,"children":3674},{"style":238},[3675],{"type":49,"value":3676}," rebase\n",{"type":44,"tag":226,"props":3678,"children":3679},{"class":228,"line":1099},[3680],{"type":44,"tag":226,"props":3681,"children":3682},{"emptyLinePlaceholder":1159},[3683],{"type":49,"value":1162},{"type":44,"tag":226,"props":3685,"children":3686},{"class":228,"line":1122},[3687],{"type":44,"tag":226,"props":3688,"children":3689},{"style":296},[3690],{"type":49,"value":3691},"# 2. If exit code 3 (conflict):\n",{"type":44,"tag":226,"props":3693,"children":3694},{"class":228,"line":1155},[3695],{"type":44,"tag":226,"props":3696,"children":3697},{"style":296},[3698],{"type":49,"value":3699},"#    - Parse stderr for conflicted file paths\n",{"type":44,"tag":226,"props":3701,"children":3702},{"class":228,"line":1165},[3703],{"type":44,"tag":226,"props":3704,"children":3705},{"style":296},[3706],{"type":49,"value":3707},"#    - Read those files to find \u003C\u003C\u003C\u003C\u003C\u003C\u003C \u002F ======= \u002F >>>>>>> markers\n",{"type":44,"tag":226,"props":3709,"children":3710},{"class":228,"line":1182},[3711],{"type":44,"tag":226,"props":3712,"children":3713},{"style":296},[3714],{"type":49,"value":3715},"#    - Edit files to resolve conflicts\n",{"type":44,"tag":226,"props":3717,"children":3718},{"class":228,"line":1211},[3719],{"type":44,"tag":226,"props":3720,"children":3721},{"style":296},[3722],{"type":49,"value":3723},"#    - Stage resolved files:\n",{"type":44,"tag":226,"props":3725,"children":3726},{"class":228,"line":1219},[3727,3731,3735],{"type":44,"tag":226,"props":3728,"children":3729},{"style":233},[3730],{"type":49,"value":19},{"type":44,"tag":226,"props":3732,"children":3733},{"style":238},[3734],{"type":49,"value":1109},{"type":44,"tag":226,"props":3736,"children":3737},{"style":238},[3738],{"type":49,"value":3739}," path\u002Fto\u002Fresolved-file.go\n",{"type":44,"tag":226,"props":3741,"children":3742},{"class":228,"line":1228},[3743],{"type":44,"tag":226,"props":3744,"children":3745},{"emptyLinePlaceholder":1159},[3746],{"type":49,"value":1162},{"type":44,"tag":226,"props":3748,"children":3749},{"class":228,"line":1255},[3750],{"type":44,"tag":226,"props":3751,"children":3752},{"style":296},[3753],{"type":49,"value":3754},"# 3. Continue the rebase\n",{"type":44,"tag":226,"props":3756,"children":3757},{"class":228,"line":1277},[3758,3762,3766,3770],{"type":44,"tag":226,"props":3759,"children":3760},{"style":233},[3761],{"type":49,"value":213},{"type":44,"tag":226,"props":3763,"children":3764},{"style":238},[3765],{"type":49,"value":1238},{"type":44,"tag":226,"props":3767,"children":3768},{"style":238},[3769],{"type":49,"value":3051},{"type":44,"tag":226,"props":3771,"children":3772},{"style":238},[3773],{"type":49,"value":3774}," --continue\n",{"type":44,"tag":226,"props":3776,"children":3777},{"class":228,"line":2118},[3778],{"type":44,"tag":226,"props":3779,"children":3780},{"emptyLinePlaceholder":1159},[3781],{"type":49,"value":1162},{"type":44,"tag":226,"props":3783,"children":3784},{"class":228,"line":2127},[3785],{"type":44,"tag":226,"props":3786,"children":3787},{"style":296},[3788],{"type":49,"value":3789},"# 4. If another conflict occurs, repeat steps 2-3\n",{"type":44,"tag":226,"props":3791,"children":3792},{"class":228,"line":2136},[3793],{"type":44,"tag":226,"props":3794,"children":3795},{"emptyLinePlaceholder":1159},[3796],{"type":49,"value":1162},{"type":44,"tag":226,"props":3798,"children":3799},{"class":228,"line":2145},[3800],{"type":44,"tag":226,"props":3801,"children":3802},{"style":296},[3803],{"type":49,"value":3804},"# 5. If unable to resolve, abort to restore everything\n",{"type":44,"tag":226,"props":3806,"children":3807},{"class":228,"line":27},[3808,3812,3816,3820],{"type":44,"tag":226,"props":3809,"children":3810},{"style":233},[3811],{"type":49,"value":213},{"type":44,"tag":226,"props":3813,"children":3814},{"style":238},[3815],{"type":49,"value":1238},{"type":44,"tag":226,"props":3817,"children":3818},{"style":238},[3819],{"type":49,"value":3051},{"type":44,"tag":226,"props":3821,"children":3822},{"style":238},[3823],{"type":49,"value":3824}," --abort\n",{"type":44,"tag":943,"props":3826,"children":3828},{"id":3827},"parsing-json-output",[3829,3831,3836],{"type":49,"value":3830},"Parsing ",{"type":44,"tag":55,"props":3832,"children":3834},{"className":3833},[],[3835],{"type":49,"value":453},{"type":49,"value":3837}," output",{"type":44,"tag":83,"props":3839,"children":3841},{"className":218,"code":3840,"language":220,"meta":91,"style":91},"# Get stack state as JSON\noutput=$(gh stack view --json)\n\n# Check if any branch needs a rebase, and rebase if so\nneeds_rebase=$(echo \"$output\" | jq '[.branches[] | select(.needsRebase == true)] | length')\nif [ \"$needs_rebase\" -gt 0 ]; then\n  echo \"Branches need rebase, rebasing stack...\"\n  gh stack rebase\nfi\n\n# Get all open PR URLs\necho \"$output\" | jq -r '.branches[] | select(.pr.state == \"OPEN\") | .pr.url'\n\n# Find merged branches\necho \"$output\" | jq -r '.branches[] | select(.isMerged == true) | .name'\n\n# Get the current branch\necho \"$output\" | jq -r '.currentBranch'\n\n# Check if the stack is fully merged (all branches merged)\necho \"$output\" | jq '[.branches[] | .isMerged] | all'\n",[3842],{"type":44,"tag":55,"props":3843,"children":3844},{"__ignoreMap":91},[3845,3853,3889,3896,3904,3965,4013,4034,4050,4058,4065,4073,4119,4126,4134,4178,4185,4193,4237,4244,4252],{"type":44,"tag":226,"props":3846,"children":3847},{"class":228,"line":229},[3848],{"type":44,"tag":226,"props":3849,"children":3850},{"style":296},[3851],{"type":49,"value":3852},"# Get stack state as JSON\n",{"type":44,"tag":226,"props":3854,"children":3855},{"class":228,"line":302},[3856,3862,3867,3871,3875,3879,3884],{"type":44,"tag":226,"props":3857,"children":3859},{"style":3858},"--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8",[3860],{"type":49,"value":3861},"output",{"type":44,"tag":226,"props":3863,"children":3864},{"style":290},[3865],{"type":49,"value":3866},"=$(",{"type":44,"tag":226,"props":3868,"children":3869},{"style":233},[3870],{"type":49,"value":213},{"type":44,"tag":226,"props":3872,"children":3873},{"style":238},[3874],{"type":49,"value":1238},{"type":44,"tag":226,"props":3876,"children":3877},{"style":238},[3878],{"type":49,"value":2795},{"type":44,"tag":226,"props":3880,"children":3881},{"style":238},[3882],{"type":49,"value":3883}," --json",{"type":44,"tag":226,"props":3885,"children":3886},{"style":290},[3887],{"type":49,"value":3888},")\n",{"type":44,"tag":226,"props":3890,"children":3891},{"class":228,"line":1099},[3892],{"type":44,"tag":226,"props":3893,"children":3894},{"emptyLinePlaceholder":1159},[3895],{"type":49,"value":1162},{"type":44,"tag":226,"props":3897,"children":3898},{"class":228,"line":1122},[3899],{"type":44,"tag":226,"props":3900,"children":3901},{"style":296},[3902],{"type":49,"value":3903},"# Check if any branch needs a rebase, and rebase if so\n",{"type":44,"tag":226,"props":3905,"children":3906},{"class":228,"line":1155},[3907,3912,3916,3922,3926,3931,3936,3941,3946,3951,3956,3961],{"type":44,"tag":226,"props":3908,"children":3909},{"style":3858},[3910],{"type":49,"value":3911},"needs_rebase",{"type":44,"tag":226,"props":3913,"children":3914},{"style":290},[3915],{"type":49,"value":3866},{"type":44,"tag":226,"props":3917,"children":3919},{"style":3918},"--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF",[3920],{"type":49,"value":3921},"echo",{"type":44,"tag":226,"props":3923,"children":3924},{"style":290},[3925],{"type":49,"value":1142},{"type":44,"tag":226,"props":3927,"children":3928},{"style":3858},[3929],{"type":49,"value":3930},"$output",{"type":44,"tag":226,"props":3932,"children":3933},{"style":290},[3934],{"type":49,"value":3935},"\"",{"type":44,"tag":226,"props":3937,"children":3938},{"style":290},[3939],{"type":49,"value":3940}," |",{"type":44,"tag":226,"props":3942,"children":3943},{"style":233},[3944],{"type":49,"value":3945}," jq",{"type":44,"tag":226,"props":3947,"children":3948},{"style":290},[3949],{"type":49,"value":3950}," '",{"type":44,"tag":226,"props":3952,"children":3953},{"style":238},[3954],{"type":49,"value":3955},"[.branches[] | select(.needsRebase == true)] | length",{"type":44,"tag":226,"props":3957,"children":3958},{"style":290},[3959],{"type":49,"value":3960},"'",{"type":44,"tag":226,"props":3962,"children":3963},{"style":290},[3964],{"type":49,"value":3888},{"type":44,"tag":226,"props":3966,"children":3967},{"class":228,"line":1165},[3968,3974,3979,3983,3988,3992,3997,4003,4008],{"type":44,"tag":226,"props":3969,"children":3971},{"style":3970},"--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic",[3972],{"type":49,"value":3973},"if",{"type":44,"tag":226,"props":3975,"children":3976},{"style":290},[3977],{"type":49,"value":3978}," [",{"type":44,"tag":226,"props":3980,"children":3981},{"style":290},[3982],{"type":49,"value":1142},{"type":44,"tag":226,"props":3984,"children":3985},{"style":3858},[3986],{"type":49,"value":3987},"$needs_rebase",{"type":44,"tag":226,"props":3989,"children":3990},{"style":290},[3991],{"type":49,"value":3935},{"type":44,"tag":226,"props":3993,"children":3994},{"style":290},[3995],{"type":49,"value":3996}," -gt",{"type":44,"tag":226,"props":3998,"children":4000},{"style":3999},"--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C",[4001],{"type":49,"value":4002}," 0",{"type":44,"tag":226,"props":4004,"children":4005},{"style":290},[4006],{"type":49,"value":4007}," ];",{"type":44,"tag":226,"props":4009,"children":4010},{"style":3970},[4011],{"type":49,"value":4012}," then\n",{"type":44,"tag":226,"props":4014,"children":4015},{"class":228,"line":1182},[4016,4021,4025,4030],{"type":44,"tag":226,"props":4017,"children":4018},{"style":3918},[4019],{"type":49,"value":4020},"  echo",{"type":44,"tag":226,"props":4022,"children":4023},{"style":290},[4024],{"type":49,"value":1142},{"type":44,"tag":226,"props":4026,"children":4027},{"style":238},[4028],{"type":49,"value":4029},"Branches need rebase, rebasing stack...",{"type":44,"tag":226,"props":4031,"children":4032},{"style":290},[4033],{"type":49,"value":1152},{"type":44,"tag":226,"props":4035,"children":4036},{"class":228,"line":1211},[4037,4042,4046],{"type":44,"tag":226,"props":4038,"children":4039},{"style":233},[4040],{"type":49,"value":4041},"  gh",{"type":44,"tag":226,"props":4043,"children":4044},{"style":238},[4045],{"type":49,"value":1238},{"type":44,"tag":226,"props":4047,"children":4048},{"style":238},[4049],{"type":49,"value":3676},{"type":44,"tag":226,"props":4051,"children":4052},{"class":228,"line":1219},[4053],{"type":44,"tag":226,"props":4054,"children":4055},{"style":3970},[4056],{"type":49,"value":4057},"fi\n",{"type":44,"tag":226,"props":4059,"children":4060},{"class":228,"line":1228},[4061],{"type":44,"tag":226,"props":4062,"children":4063},{"emptyLinePlaceholder":1159},[4064],{"type":49,"value":1162},{"type":44,"tag":226,"props":4066,"children":4067},{"class":228,"line":1255},[4068],{"type":44,"tag":226,"props":4069,"children":4070},{"style":296},[4071],{"type":49,"value":4072},"# Get all open PR URLs\n",{"type":44,"tag":226,"props":4074,"children":4075},{"class":228,"line":1277},[4076,4080,4084,4088,4092,4096,4100,4105,4109,4114],{"type":44,"tag":226,"props":4077,"children":4078},{"style":3918},[4079],{"type":49,"value":3921},{"type":44,"tag":226,"props":4081,"children":4082},{"style":290},[4083],{"type":49,"value":1142},{"type":44,"tag":226,"props":4085,"children":4086},{"style":3858},[4087],{"type":49,"value":3930},{"type":44,"tag":226,"props":4089,"children":4090},{"style":290},[4091],{"type":49,"value":3935},{"type":44,"tag":226,"props":4093,"children":4094},{"style":290},[4095],{"type":49,"value":3940},{"type":44,"tag":226,"props":4097,"children":4098},{"style":233},[4099],{"type":49,"value":3945},{"type":44,"tag":226,"props":4101,"children":4102},{"style":238},[4103],{"type":49,"value":4104}," -r",{"type":44,"tag":226,"props":4106,"children":4107},{"style":290},[4108],{"type":49,"value":3950},{"type":44,"tag":226,"props":4110,"children":4111},{"style":238},[4112],{"type":49,"value":4113},".branches[] | select(.pr.state == \"OPEN\") | .pr.url",{"type":44,"tag":226,"props":4115,"children":4116},{"style":290},[4117],{"type":49,"value":4118},"'\n",{"type":44,"tag":226,"props":4120,"children":4121},{"class":228,"line":2118},[4122],{"type":44,"tag":226,"props":4123,"children":4124},{"emptyLinePlaceholder":1159},[4125],{"type":49,"value":1162},{"type":44,"tag":226,"props":4127,"children":4128},{"class":228,"line":2127},[4129],{"type":44,"tag":226,"props":4130,"children":4131},{"style":296},[4132],{"type":49,"value":4133},"# Find merged branches\n",{"type":44,"tag":226,"props":4135,"children":4136},{"class":228,"line":2136},[4137,4141,4145,4149,4153,4157,4161,4165,4169,4174],{"type":44,"tag":226,"props":4138,"children":4139},{"style":3918},[4140],{"type":49,"value":3921},{"type":44,"tag":226,"props":4142,"children":4143},{"style":290},[4144],{"type":49,"value":1142},{"type":44,"tag":226,"props":4146,"children":4147},{"style":3858},[4148],{"type":49,"value":3930},{"type":44,"tag":226,"props":4150,"children":4151},{"style":290},[4152],{"type":49,"value":3935},{"type":44,"tag":226,"props":4154,"children":4155},{"style":290},[4156],{"type":49,"value":3940},{"type":44,"tag":226,"props":4158,"children":4159},{"style":233},[4160],{"type":49,"value":3945},{"type":44,"tag":226,"props":4162,"children":4163},{"style":238},[4164],{"type":49,"value":4104},{"type":44,"tag":226,"props":4166,"children":4167},{"style":290},[4168],{"type":49,"value":3950},{"type":44,"tag":226,"props":4170,"children":4171},{"style":238},[4172],{"type":49,"value":4173},".branches[] | select(.isMerged == true) | .name",{"type":44,"tag":226,"props":4175,"children":4176},{"style":290},[4177],{"type":49,"value":4118},{"type":44,"tag":226,"props":4179,"children":4180},{"class":228,"line":2145},[4181],{"type":44,"tag":226,"props":4182,"children":4183},{"emptyLinePlaceholder":1159},[4184],{"type":49,"value":1162},{"type":44,"tag":226,"props":4186,"children":4187},{"class":228,"line":27},[4188],{"type":44,"tag":226,"props":4189,"children":4190},{"style":296},[4191],{"type":49,"value":4192},"# Get the current branch\n",{"type":44,"tag":226,"props":4194,"children":4195},{"class":228,"line":2161},[4196,4200,4204,4208,4212,4216,4220,4224,4228,4233],{"type":44,"tag":226,"props":4197,"children":4198},{"style":3918},[4199],{"type":49,"value":3921},{"type":44,"tag":226,"props":4201,"children":4202},{"style":290},[4203],{"type":49,"value":1142},{"type":44,"tag":226,"props":4205,"children":4206},{"style":3858},[4207],{"type":49,"value":3930},{"type":44,"tag":226,"props":4209,"children":4210},{"style":290},[4211],{"type":49,"value":3935},{"type":44,"tag":226,"props":4213,"children":4214},{"style":290},[4215],{"type":49,"value":3940},{"type":44,"tag":226,"props":4217,"children":4218},{"style":233},[4219],{"type":49,"value":3945},{"type":44,"tag":226,"props":4221,"children":4222},{"style":238},[4223],{"type":49,"value":4104},{"type":44,"tag":226,"props":4225,"children":4226},{"style":290},[4227],{"type":49,"value":3950},{"type":44,"tag":226,"props":4229,"children":4230},{"style":238},[4231],{"type":49,"value":4232},".currentBranch",{"type":44,"tag":226,"props":4234,"children":4235},{"style":290},[4236],{"type":49,"value":4118},{"type":44,"tag":226,"props":4238,"children":4239},{"class":228,"line":2178},[4240],{"type":44,"tag":226,"props":4241,"children":4242},{"emptyLinePlaceholder":1159},[4243],{"type":49,"value":1162},{"type":44,"tag":226,"props":4245,"children":4246},{"class":228,"line":2207},[4247],{"type":44,"tag":226,"props":4248,"children":4249},{"style":296},[4250],{"type":49,"value":4251},"# Check if the stack is fully merged (all branches merged)\n",{"type":44,"tag":226,"props":4253,"children":4254},{"class":228,"line":2215},[4255,4259,4263,4267,4271,4275,4279,4283,4288],{"type":44,"tag":226,"props":4256,"children":4257},{"style":3918},[4258],{"type":49,"value":3921},{"type":44,"tag":226,"props":4260,"children":4261},{"style":290},[4262],{"type":49,"value":1142},{"type":44,"tag":226,"props":4264,"children":4265},{"style":3858},[4266],{"type":49,"value":3930},{"type":44,"tag":226,"props":4268,"children":4269},{"style":290},[4270],{"type":49,"value":3935},{"type":44,"tag":226,"props":4272,"children":4273},{"style":290},[4274],{"type":49,"value":3940},{"type":44,"tag":226,"props":4276,"children":4277},{"style":233},[4278],{"type":49,"value":3945},{"type":44,"tag":226,"props":4280,"children":4281},{"style":290},[4282],{"type":49,"value":3950},{"type":44,"tag":226,"props":4284,"children":4285},{"style":238},[4286],{"type":49,"value":4287},"[.branches[] | .isMerged] | all",{"type":44,"tag":226,"props":4289,"children":4290},{"style":290},[4291],{"type":49,"value":4118},{"type":44,"tag":943,"props":4293,"children":4295},{"id":4294},"restructure-a-stack-remove-a-branch-reorder-or-rename",[4296],{"type":49,"value":4297},"Restructure a stack (remove a branch, reorder, or rename)",{"type":44,"tag":51,"props":4299,"children":4300},{},[4301,4302,4308],{"type":49,"value":691},{"type":44,"tag":55,"props":4303,"children":4305},{"className":4304},[],[4306],{"type":49,"value":4307},"unstack",{"type":49,"value":4309}," to tear down the stack, make structural changes, then re-init:",{"type":44,"tag":83,"props":4311,"children":4313},{"className":218,"code":4312,"language":220,"meta":91,"style":91},"# 1. Remove the local tracking and the GitHub stack grouping (PRs are NOT deleted)\ngh stack unstack\n\n# 2. Make structural changes — e.g. delete a branch, reorder, rename\ngit branch -m old-branch-1 new-branch-1\n\n# 3. Re-create the stack with the new structure\ngh stack init --base main new-branch-1 new-branch-2 new-branch-3\n",[4314],{"type":44,"tag":55,"props":4315,"children":4316},{"__ignoreMap":91},[4317,4325,4341,4348,4356,4382,4389,4397],{"type":44,"tag":226,"props":4318,"children":4319},{"class":228,"line":229},[4320],{"type":44,"tag":226,"props":4321,"children":4322},{"style":296},[4323],{"type":49,"value":4324},"# 1. Remove the local tracking and the GitHub stack grouping (PRs are NOT deleted)\n",{"type":44,"tag":226,"props":4326,"children":4327},{"class":228,"line":302},[4328,4332,4336],{"type":44,"tag":226,"props":4329,"children":4330},{"style":233},[4331],{"type":49,"value":213},{"type":44,"tag":226,"props":4333,"children":4334},{"style":238},[4335],{"type":49,"value":1238},{"type":44,"tag":226,"props":4337,"children":4338},{"style":238},[4339],{"type":49,"value":4340}," unstack\n",{"type":44,"tag":226,"props":4342,"children":4343},{"class":228,"line":1099},[4344],{"type":44,"tag":226,"props":4345,"children":4346},{"emptyLinePlaceholder":1159},[4347],{"type":49,"value":1162},{"type":44,"tag":226,"props":4349,"children":4350},{"class":228,"line":1122},[4351],{"type":44,"tag":226,"props":4352,"children":4353},{"style":296},[4354],{"type":49,"value":4355},"# 2. Make structural changes — e.g. delete a branch, reorder, rename\n",{"type":44,"tag":226,"props":4357,"children":4358},{"class":228,"line":1155},[4359,4363,4368,4372,4377],{"type":44,"tag":226,"props":4360,"children":4361},{"style":233},[4362],{"type":49,"value":19},{"type":44,"tag":226,"props":4364,"children":4365},{"style":238},[4366],{"type":49,"value":4367}," branch",{"type":44,"tag":226,"props":4369,"children":4370},{"style":238},[4371],{"type":49,"value":1137},{"type":44,"tag":226,"props":4373,"children":4374},{"style":238},[4375],{"type":49,"value":4376}," old-branch-1",{"type":44,"tag":226,"props":4378,"children":4379},{"style":238},[4380],{"type":49,"value":4381}," new-branch-1\n",{"type":44,"tag":226,"props":4383,"children":4384},{"class":228,"line":1165},[4385],{"type":44,"tag":226,"props":4386,"children":4387},{"emptyLinePlaceholder":1159},[4388],{"type":49,"value":1162},{"type":44,"tag":226,"props":4390,"children":4391},{"class":228,"line":1182},[4392],{"type":44,"tag":226,"props":4393,"children":4394},{"style":296},[4395],{"type":49,"value":4396},"# 3. Re-create the stack with the new structure\n",{"type":44,"tag":226,"props":4398,"children":4399},{"class":228,"line":1211},[4400,4404,4408,4412,4417,4422,4427,4432],{"type":44,"tag":226,"props":4401,"children":4402},{"style":233},[4403],{"type":49,"value":213},{"type":44,"tag":226,"props":4405,"children":4406},{"style":238},[4407],{"type":49,"value":1238},{"type":44,"tag":226,"props":4409,"children":4410},{"style":238},[4411],{"type":49,"value":2012},{"type":44,"tag":226,"props":4413,"children":4414},{"style":238},[4415],{"type":49,"value":4416}," --base",{"type":44,"tag":226,"props":4418,"children":4419},{"style":238},[4420],{"type":49,"value":4421}," main",{"type":44,"tag":226,"props":4423,"children":4424},{"style":238},[4425],{"type":49,"value":4426}," new-branch-1",{"type":44,"tag":226,"props":4428,"children":4429},{"style":238},[4430],{"type":49,"value":4431}," new-branch-2",{"type":44,"tag":226,"props":4433,"children":4434},{"style":238},[4435],{"type":49,"value":4436}," new-branch-3\n",{"type":44,"tag":1967,"props":4438,"children":4439},{},[],{"type":44,"tag":156,"props":4441,"children":4443},{"id":4442},"commands",[4444],{"type":49,"value":4445},"Commands",{"type":44,"tag":943,"props":4447,"children":4449},{"id":4448},"initialize-a-stack-gh-stack-init",[4450,4452],{"type":49,"value":4451},"Initialize a stack — ",{"type":44,"tag":55,"props":4453,"children":4455},{"className":4454},[],[4456],{"type":49,"value":607},{"type":44,"tag":51,"props":4458,"children":4459},{},[4460,4462,4467],{"type":49,"value":4461},"Creates a new stack. ",{"type":44,"tag":75,"props":4463,"children":4464},{},[4465],{"type":49,"value":4466},"Always provide at least one branch name as a positional argument",{"type":49,"value":4468}," — running without branch arguments triggers interactive prompts that agents cannot use.",{"type":44,"tag":83,"props":4470,"children":4473},{"className":4471,"code":4472,"language":49},[86],"gh stack init [flags] \u003Cbranches...>\n",[4474],{"type":44,"tag":55,"props":4475,"children":4476},{"__ignoreMap":91},[4477],{"type":49,"value":4472},{"type":44,"tag":83,"props":4479,"children":4481},{"className":218,"code":4480,"language":220,"meta":91,"style":91},"# Create a stack with a new branch\ngh stack init auth\n# → creates auth and checks it out\n\n# Create a stack with new branches\ngh stack init branch-a branch-b branch-c\n\n# Use a different trunk branch\ngh stack init --base develop branch-a branch-b\n\n# Adopt existing branches into a stack (handled automatically if the branches exist)\ngh stack init branch-a branch-b branch-c\n",[4482],{"type":44,"tag":55,"props":4483,"children":4484},{"__ignoreMap":91},[4485,4493,4512,4519,4526,4534,4564,4571,4579,4612,4619,4627],{"type":44,"tag":226,"props":4486,"children":4487},{"class":228,"line":229},[4488],{"type":44,"tag":226,"props":4489,"children":4490},{"style":296},[4491],{"type":49,"value":4492},"# Create a stack with a new branch\n",{"type":44,"tag":226,"props":4494,"children":4495},{"class":228,"line":302},[4496,4500,4504,4508],{"type":44,"tag":226,"props":4497,"children":4498},{"style":233},[4499],{"type":49,"value":213},{"type":44,"tag":226,"props":4501,"children":4502},{"style":238},[4503],{"type":49,"value":1238},{"type":44,"tag":226,"props":4505,"children":4506},{"style":238},[4507],{"type":49,"value":2012},{"type":44,"tag":226,"props":4509,"children":4510},{"style":238},[4511],{"type":49,"value":2017},{"type":44,"tag":226,"props":4513,"children":4514},{"class":228,"line":1099},[4515],{"type":44,"tag":226,"props":4516,"children":4517},{"style":296},[4518],{"type":49,"value":2025},{"type":44,"tag":226,"props":4520,"children":4521},{"class":228,"line":1122},[4522],{"type":44,"tag":226,"props":4523,"children":4524},{"emptyLinePlaceholder":1159},[4525],{"type":49,"value":1162},{"type":44,"tag":226,"props":4527,"children":4528},{"class":228,"line":1155},[4529],{"type":44,"tag":226,"props":4530,"children":4531},{"style":296},[4532],{"type":49,"value":4533},"# Create a stack with new branches\n",{"type":44,"tag":226,"props":4535,"children":4536},{"class":228,"line":1165},[4537,4541,4545,4549,4554,4559],{"type":44,"tag":226,"props":4538,"children":4539},{"style":233},[4540],{"type":49,"value":213},{"type":44,"tag":226,"props":4542,"children":4543},{"style":238},[4544],{"type":49,"value":1238},{"type":44,"tag":226,"props":4546,"children":4547},{"style":238},[4548],{"type":49,"value":2012},{"type":44,"tag":226,"props":4550,"children":4551},{"style":238},[4552],{"type":49,"value":4553}," branch-a",{"type":44,"tag":226,"props":4555,"children":4556},{"style":238},[4557],{"type":49,"value":4558}," branch-b",{"type":44,"tag":226,"props":4560,"children":4561},{"style":238},[4562],{"type":49,"value":4563}," branch-c\n",{"type":44,"tag":226,"props":4565,"children":4566},{"class":228,"line":1182},[4567],{"type":44,"tag":226,"props":4568,"children":4569},{"emptyLinePlaceholder":1159},[4570],{"type":49,"value":1162},{"type":44,"tag":226,"props":4572,"children":4573},{"class":228,"line":1211},[4574],{"type":44,"tag":226,"props":4575,"children":4576},{"style":296},[4577],{"type":49,"value":4578},"# Use a different trunk branch\n",{"type":44,"tag":226,"props":4580,"children":4581},{"class":228,"line":1219},[4582,4586,4590,4594,4598,4603,4607],{"type":44,"tag":226,"props":4583,"children":4584},{"style":233},[4585],{"type":49,"value":213},{"type":44,"tag":226,"props":4587,"children":4588},{"style":238},[4589],{"type":49,"value":1238},{"type":44,"tag":226,"props":4591,"children":4592},{"style":238},[4593],{"type":49,"value":2012},{"type":44,"tag":226,"props":4595,"children":4596},{"style":238},[4597],{"type":49,"value":4416},{"type":44,"tag":226,"props":4599,"children":4600},{"style":238},[4601],{"type":49,"value":4602}," develop",{"type":44,"tag":226,"props":4604,"children":4605},{"style":238},[4606],{"type":49,"value":4553},{"type":44,"tag":226,"props":4608,"children":4609},{"style":238},[4610],{"type":49,"value":4611}," branch-b\n",{"type":44,"tag":226,"props":4613,"children":4614},{"class":228,"line":1228},[4615],{"type":44,"tag":226,"props":4616,"children":4617},{"emptyLinePlaceholder":1159},[4618],{"type":49,"value":1162},{"type":44,"tag":226,"props":4620,"children":4621},{"class":228,"line":1255},[4622],{"type":44,"tag":226,"props":4623,"children":4624},{"style":296},[4625],{"type":49,"value":4626},"# Adopt existing branches into a stack (handled automatically if the branches exist)\n",{"type":44,"tag":226,"props":4628,"children":4629},{"class":228,"line":1277},[4630,4634,4638,4642,4646,4650],{"type":44,"tag":226,"props":4631,"children":4632},{"style":233},[4633],{"type":49,"value":213},{"type":44,"tag":226,"props":4635,"children":4636},{"style":238},[4637],{"type":49,"value":1238},{"type":44,"tag":226,"props":4639,"children":4640},{"style":238},[4641],{"type":49,"value":2012},{"type":44,"tag":226,"props":4643,"children":4644},{"style":238},[4645],{"type":49,"value":4553},{"type":44,"tag":226,"props":4647,"children":4648},{"style":238},[4649],{"type":49,"value":4558},{"type":44,"tag":226,"props":4651,"children":4652},{"style":238},[4653],{"type":49,"value":4563},{"type":44,"tag":1421,"props":4655,"children":4656},{},[4657,4673],{"type":44,"tag":1425,"props":4658,"children":4659},{},[4660],{"type":44,"tag":1429,"props":4661,"children":4662},{},[4663,4668],{"type":44,"tag":1433,"props":4664,"children":4665},{},[4666],{"type":49,"value":4667},"Flag",{"type":44,"tag":1433,"props":4669,"children":4670},{},[4671],{"type":49,"value":4672},"Description",{"type":44,"tag":1444,"props":4674,"children":4675},{},[4676],{"type":44,"tag":1429,"props":4677,"children":4678},{},[4679,4688],{"type":44,"tag":1451,"props":4680,"children":4681},{},[4682],{"type":44,"tag":55,"props":4683,"children":4685},{"className":4684},[],[4686],{"type":49,"value":4687},"-b, --base \u003Cbranch>",{"type":44,"tag":1451,"props":4689,"children":4690},{},[4691],{"type":49,"value":4692},"Trunk branch (defaults to the repo's default branch)",{"type":44,"tag":51,"props":4694,"children":4695},{},[4696],{"type":44,"tag":75,"props":4697,"children":4698},{},[4699],{"type":49,"value":4700},"Behavior:",{"type":44,"tag":168,"props":4702,"children":4703},{},[4704,4709,4714,4719,4724],{"type":44,"tag":172,"props":4705,"children":4706},{},[4707],{"type":49,"value":4708},"Branch names are created exactly as given (slashes are allowed and kept as-is)",{"type":44,"tag":172,"props":4710,"children":4711},{},[4712],{"type":49,"value":4713},"Creates any branches that don't already exist (branching from the trunk branch)",{"type":44,"tag":172,"props":4715,"children":4716},{},[4717],{"type":49,"value":4718},"Existing branches are adopted automatically; missing branches are created from the trunk",{"type":44,"tag":172,"props":4720,"children":4721},{},[4722],{"type":49,"value":4723},"Checks out the last branch in the list",{"type":44,"tag":172,"props":4725,"children":4726},{},[4727,4729,4735,4737,4743],{"type":49,"value":4728},"Enables ",{"type":44,"tag":55,"props":4730,"children":4732},{"className":4731},[],[4733],{"type":49,"value":4734},"git rerere",{"type":49,"value":4736}," so conflict resolutions are remembered across rebases. On first run in a repo, this may trigger a confirmation prompt — pre-configure with ",{"type":44,"tag":55,"props":4738,"children":4740},{"className":4739},[],[4741],{"type":49,"value":4742},"git config rerere.enabled true",{"type":49,"value":4744}," to avoid it",{"type":44,"tag":1967,"props":4746,"children":4747},{},[],{"type":44,"tag":943,"props":4749,"children":4751},{"id":4750},"add-a-branch-gh-stack-add",[4752,4754],{"type":49,"value":4753},"Add a branch — ",{"type":44,"tag":55,"props":4755,"children":4757},{"className":4756},[],[4758],{"type":49,"value":890},{"type":44,"tag":51,"props":4760,"children":4761},{},[4762,4764,4769],{"type":49,"value":4763},"Add a new branch on top of the current stack. Must be run while on the topmost branch (or the trunk if the stack has no branches yet). ",{"type":44,"tag":75,"props":4765,"children":4766},{},[4767],{"type":49,"value":4768},"Always provide a branch name",{"type":49,"value":4770}," — running without one triggers an interactive prompt.",{"type":44,"tag":83,"props":4772,"children":4775},{"className":4773,"code":4774,"language":49},[86],"gh stack add [flags] \u003Cbranch>\n",[4776],{"type":44,"tag":55,"props":4777,"children":4778},{"__ignoreMap":91},[4779],{"type":49,"value":4774},{"type":44,"tag":51,"props":4781,"children":4782},{},[4783],{"type":44,"tag":75,"props":4784,"children":4785},{},[4786],{"type":49,"value":4787},"Recommended workflow — create the branch, then use standard git:",{"type":44,"tag":83,"props":4789,"children":4791},{"className":218,"code":4790,"language":220,"meta":91,"style":91},"# Create a new branch and switch to it\ngh stack add api-routes\n\n# Write code, stage deliberately, and commit\ngit add internal\u002Fapi\u002Froutes.go internal\u002Fapi\u002Fhandlers.go\ngit commit -m \"Add user API routes\"\n\n# Make more commits on the same branch as needed\ngit add internal\u002Fapi\u002Fmiddleware.go\ngit commit -m \"Add rate limiting middleware\"\n",[4792],{"type":44,"tag":55,"props":4793,"children":4794},{"__ignoreMap":91},[4795,4803,4822,4829,4837,4856,4883,4890,4898,4914],{"type":44,"tag":226,"props":4796,"children":4797},{"class":228,"line":229},[4798],{"type":44,"tag":226,"props":4799,"children":4800},{"style":296},[4801],{"type":49,"value":4802},"# Create a new branch and switch to it\n",{"type":44,"tag":226,"props":4804,"children":4805},{"class":228,"line":302},[4806,4810,4814,4818],{"type":44,"tag":226,"props":4807,"children":4808},{"style":233},[4809],{"type":49,"value":213},{"type":44,"tag":226,"props":4811,"children":4812},{"style":238},[4813],{"type":49,"value":1238},{"type":44,"tag":226,"props":4815,"children":4816},{"style":238},[4817],{"type":49,"value":1109},{"type":44,"tag":226,"props":4819,"children":4820},{"style":238},[4821],{"type":49,"value":2380},{"type":44,"tag":226,"props":4823,"children":4824},{"class":228,"line":1099},[4825],{"type":44,"tag":226,"props":4826,"children":4827},{"emptyLinePlaceholder":1159},[4828],{"type":49,"value":1162},{"type":44,"tag":226,"props":4830,"children":4831},{"class":228,"line":1122},[4832],{"type":44,"tag":226,"props":4833,"children":4834},{"style":296},[4835],{"type":49,"value":4836},"# Write code, stage deliberately, and commit\n",{"type":44,"tag":226,"props":4838,"children":4839},{"class":228,"line":1155},[4840,4844,4848,4852],{"type":44,"tag":226,"props":4841,"children":4842},{"style":233},[4843],{"type":49,"value":19},{"type":44,"tag":226,"props":4845,"children":4846},{"style":238},[4847],{"type":49,"value":1109},{"type":44,"tag":226,"props":4849,"children":4850},{"style":238},[4851],{"type":49,"value":1269},{"type":44,"tag":226,"props":4853,"children":4854},{"style":238},[4855],{"type":49,"value":1274},{"type":44,"tag":226,"props":4857,"children":4858},{"class":228,"line":1165},[4859,4863,4867,4871,4875,4879],{"type":44,"tag":226,"props":4860,"children":4861},{"style":233},[4862],{"type":49,"value":19},{"type":44,"tag":226,"props":4864,"children":4865},{"style":238},[4866],{"type":49,"value":1132},{"type":44,"tag":226,"props":4868,"children":4869},{"style":238},[4870],{"type":49,"value":1137},{"type":44,"tag":226,"props":4872,"children":4873},{"style":290},[4874],{"type":49,"value":1142},{"type":44,"tag":226,"props":4876,"children":4877},{"style":238},[4878],{"type":49,"value":1299},{"type":44,"tag":226,"props":4880,"children":4881},{"style":290},[4882],{"type":49,"value":1152},{"type":44,"tag":226,"props":4884,"children":4885},{"class":228,"line":1182},[4886],{"type":44,"tag":226,"props":4887,"children":4888},{"emptyLinePlaceholder":1159},[4889],{"type":49,"value":1162},{"type":44,"tag":226,"props":4891,"children":4892},{"class":228,"line":1211},[4893],{"type":44,"tag":226,"props":4894,"children":4895},{"style":296},[4896],{"type":49,"value":4897},"# Make more commits on the same branch as needed\n",{"type":44,"tag":226,"props":4899,"children":4900},{"class":228,"line":1219},[4901,4905,4909],{"type":44,"tag":226,"props":4902,"children":4903},{"style":233},[4904],{"type":49,"value":19},{"type":44,"tag":226,"props":4906,"children":4907},{"style":238},[4908],{"type":49,"value":1109},{"type":44,"tag":226,"props":4910,"children":4911},{"style":238},[4912],{"type":49,"value":4913}," internal\u002Fapi\u002Fmiddleware.go\n",{"type":44,"tag":226,"props":4915,"children":4916},{"class":228,"line":1228},[4917,4921,4925,4929,4933,4938],{"type":44,"tag":226,"props":4918,"children":4919},{"style":233},[4920],{"type":49,"value":19},{"type":44,"tag":226,"props":4922,"children":4923},{"style":238},[4924],{"type":49,"value":1132},{"type":44,"tag":226,"props":4926,"children":4927},{"style":238},[4928],{"type":49,"value":1137},{"type":44,"tag":226,"props":4930,"children":4931},{"style":290},[4932],{"type":49,"value":1142},{"type":44,"tag":226,"props":4934,"children":4935},{"style":238},[4936],{"type":49,"value":4937},"Add rate limiting middleware",{"type":44,"tag":226,"props":4939,"children":4940},{"style":290},[4941],{"type":49,"value":1152},{"type":44,"tag":51,"props":4943,"children":4944},{},[4945],{"type":44,"tag":75,"props":4946,"children":4947},{},[4948],{"type":49,"value":4949},"Shortcut — stage, commit, and branch in one command:",{"type":44,"tag":83,"props":4951,"children":4953},{"className":218,"code":4952,"language":220,"meta":91,"style":91},"# Create a new branch, stage all changes, and commit\ngh stack add -Am \"Add API routes\" api-routes\n\n# Create a new branch, stage tracked files only, and commit\ngh stack add -um \"Fix auth bug\" auth-fix\n",[4954],{"type":44,"tag":55,"props":4955,"children":4956},{"__ignoreMap":91},[4957,4965,5001,5008,5016],{"type":44,"tag":226,"props":4958,"children":4959},{"class":228,"line":229},[4960],{"type":44,"tag":226,"props":4961,"children":4962},{"style":296},[4963],{"type":49,"value":4964},"# Create a new branch, stage all changes, and commit\n",{"type":44,"tag":226,"props":4966,"children":4967},{"class":228,"line":302},[4968,4972,4976,4980,4985,4989,4993,4997],{"type":44,"tag":226,"props":4969,"children":4970},{"style":233},[4971],{"type":49,"value":213},{"type":44,"tag":226,"props":4973,"children":4974},{"style":238},[4975],{"type":49,"value":1238},{"type":44,"tag":226,"props":4977,"children":4978},{"style":238},[4979],{"type":49,"value":1109},{"type":44,"tag":226,"props":4981,"children":4982},{"style":238},[4983],{"type":49,"value":4984}," -Am",{"type":44,"tag":226,"props":4986,"children":4987},{"style":290},[4988],{"type":49,"value":1142},{"type":44,"tag":226,"props":4990,"children":4991},{"style":238},[4992],{"type":49,"value":2524},{"type":44,"tag":226,"props":4994,"children":4995},{"style":290},[4996],{"type":49,"value":3935},{"type":44,"tag":226,"props":4998,"children":4999},{"style":238},[5000],{"type":49,"value":2380},{"type":44,"tag":226,"props":5002,"children":5003},{"class":228,"line":1099},[5004],{"type":44,"tag":226,"props":5005,"children":5006},{"emptyLinePlaceholder":1159},[5007],{"type":49,"value":1162},{"type":44,"tag":226,"props":5009,"children":5010},{"class":228,"line":1122},[5011],{"type":44,"tag":226,"props":5012,"children":5013},{"style":296},[5014],{"type":49,"value":5015},"# Create a new branch, stage tracked files only, and commit\n",{"type":44,"tag":226,"props":5017,"children":5018},{"class":228,"line":1155},[5019,5023,5027,5031,5036,5040,5045,5049],{"type":44,"tag":226,"props":5020,"children":5021},{"style":233},[5022],{"type":49,"value":213},{"type":44,"tag":226,"props":5024,"children":5025},{"style":238},[5026],{"type":49,"value":1238},{"type":44,"tag":226,"props":5028,"children":5029},{"style":238},[5030],{"type":49,"value":1109},{"type":44,"tag":226,"props":5032,"children":5033},{"style":238},[5034],{"type":49,"value":5035}," -um",{"type":44,"tag":226,"props":5037,"children":5038},{"style":290},[5039],{"type":49,"value":1142},{"type":44,"tag":226,"props":5041,"children":5042},{"style":238},[5043],{"type":49,"value":5044},"Fix auth bug",{"type":44,"tag":226,"props":5046,"children":5047},{"style":290},[5048],{"type":49,"value":3935},{"type":44,"tag":226,"props":5050,"children":5051},{"style":238},[5052],{"type":49,"value":5053}," auth-fix\n",{"type":44,"tag":1421,"props":5055,"children":5056},{},[5057,5071],{"type":44,"tag":1425,"props":5058,"children":5059},{},[5060],{"type":44,"tag":1429,"props":5061,"children":5062},{},[5063,5067],{"type":44,"tag":1433,"props":5064,"children":5065},{},[5066],{"type":49,"value":4667},{"type":44,"tag":1433,"props":5068,"children":5069},{},[5070],{"type":49,"value":4672},{"type":44,"tag":1444,"props":5072,"children":5073},{},[5074,5091,5116],{"type":44,"tag":1429,"props":5075,"children":5076},{},[5077,5086],{"type":44,"tag":1451,"props":5078,"children":5079},{},[5080],{"type":44,"tag":55,"props":5081,"children":5083},{"className":5082},[],[5084],{"type":49,"value":5085},"-m, --message \u003Cstring>",{"type":44,"tag":1451,"props":5087,"children":5088},{},[5089],{"type":49,"value":5090},"Create a commit with this message",{"type":44,"tag":1429,"props":5092,"children":5093},{},[5094,5103],{"type":44,"tag":1451,"props":5095,"children":5096},{},[5097],{"type":44,"tag":55,"props":5098,"children":5100},{"className":5099},[],[5101],{"type":49,"value":5102},"-A, --all",{"type":44,"tag":1451,"props":5104,"children":5105},{},[5106,5108,5114],{"type":49,"value":5107},"Stage all changes including untracked files (requires ",{"type":44,"tag":55,"props":5109,"children":5111},{"className":5110},[],[5112],{"type":49,"value":5113},"-m",{"type":49,"value":5115},")",{"type":44,"tag":1429,"props":5117,"children":5118},{},[5119,5128],{"type":44,"tag":1451,"props":5120,"children":5121},{},[5122],{"type":44,"tag":55,"props":5123,"children":5125},{"className":5124},[],[5126],{"type":49,"value":5127},"-u, --update",{"type":44,"tag":1451,"props":5129,"children":5130},{},[5131,5133,5138],{"type":49,"value":5132},"Stage tracked files only (requires ",{"type":44,"tag":55,"props":5134,"children":5136},{"className":5135},[],[5137],{"type":49,"value":5113},{"type":49,"value":5115},{"type":44,"tag":51,"props":5140,"children":5141},{},[5142],{"type":44,"tag":75,"props":5143,"children":5144},{},[5145],{"type":49,"value":5146},"Behavior notes:",{"type":44,"tag":168,"props":5148,"children":5149},{},[5150,5168,5188,5224,5244],{"type":44,"tag":172,"props":5151,"children":5152},{},[5153,5159,5160,5166],{"type":44,"tag":55,"props":5154,"children":5156},{"className":5155},[],[5157],{"type":49,"value":5158},"-A",{"type":49,"value":624},{"type":44,"tag":55,"props":5161,"children":5163},{"className":5162},[],[5164],{"type":49,"value":5165},"-u",{"type":49,"value":5167}," are mutually exclusive.",{"type":44,"tag":172,"props":5169,"children":5170},{},[5171,5173,5178,5180,5186],{"type":49,"value":5172},"When the current branch has no commits (e.g., right after ",{"type":44,"tag":55,"props":5174,"children":5176},{"className":5175},[],[5177],{"type":49,"value":369},{"type":49,"value":5179},"), ",{"type":44,"tag":55,"props":5181,"children":5183},{"className":5182},[],[5184],{"type":49,"value":5185},"add -Am",{"type":49,"value":5187}," commits directly on the current branch instead of creating a new one.",{"type":44,"tag":172,"props":5189,"children":5190},{},[5191,5196,5197,5202,5203,5208,5210,5215,5217,5223],{"type":44,"tag":75,"props":5192,"children":5193},{},[5194],{"type":49,"value":5195},"Branch names are used verbatim.",{"type":49,"value":740},{"type":44,"tag":55,"props":5198,"children":5200},{"className":5199},[],[5201],{"type":49,"value":392},{"type":49,"value":394},{"type":44,"tag":55,"props":5204,"children":5206},{"className":5205},[],[5207],{"type":49,"value":400},{"type":49,"value":5209}," — names are never prefixed or transformed. When ",{"type":44,"tag":55,"props":5211,"children":5213},{"className":5212},[],[5214],{"type":49,"value":5113},{"type":49,"value":5216}," is given without a branch name, the name is auto-generated from the commit message in date+slug format (e.g., ",{"type":44,"tag":55,"props":5218,"children":5220},{"className":5219},[],[5221],{"type":49,"value":5222},"03-24-add_api_routes",{"type":49,"value":723},{"type":44,"tag":172,"props":5225,"children":5226},{},[5227,5229,5235,5237,5242],{"type":49,"value":5228},"If called from a branch that is not the topmost in the stack, exits with code 5: ",{"type":44,"tag":55,"props":5230,"children":5232},{"className":5231},[],[5233],{"type":49,"value":5234},"\"can only add branches on top of the stack\"",{"type":49,"value":5236},". Use ",{"type":44,"tag":55,"props":5238,"children":5240},{"className":5239},[],[5241],{"type":49,"value":1809},{"type":49,"value":5243}," to switch first.",{"type":44,"tag":172,"props":5245,"children":5246},{},[5247,5252,5254,5260,5261,5266,5268,5273],{"type":44,"tag":75,"props":5248,"children":5249},{},[5250],{"type":49,"value":5251},"Uncommitted changes:",{"type":49,"value":5253}," When using ",{"type":44,"tag":55,"props":5255,"children":5257},{"className":5256},[],[5258],{"type":49,"value":5259},"gh stack add branch-name",{"type":49,"value":857},{"type":44,"tag":55,"props":5262,"children":5264},{"className":5263},[],[5265],{"type":49,"value":640},{"type":49,"value":5267},", any uncommitted changes (staged or unstaged) in your working tree carry over to the new branch. This is standard git behavior — the working tree is not touched. Commit or stash changes on the current branch before running ",{"type":44,"tag":55,"props":5269,"children":5271},{"className":5270},[],[5272],{"type":49,"value":376},{"type":49,"value":5274}," if you want a clean starting point on the new branch.",{"type":44,"tag":1967,"props":5276,"children":5277},{},[],{"type":44,"tag":943,"props":5279,"children":5281},{"id":5280},"push-branches-to-remote-gh-stack-push",[5282,5284],{"type":49,"value":5283},"Push branches to remote — ",{"type":44,"tag":55,"props":5285,"children":5287},{"className":5286},[],[5288],{"type":49,"value":1566},{"type":44,"tag":51,"props":5290,"children":5291},{},[5292],{"type":49,"value":5293},"Push active stack branches to the remote.",{"type":44,"tag":83,"props":5295,"children":5298},{"className":5296,"code":5297,"language":49},[86],"gh stack push [flags]\n",[5299],{"type":44,"tag":55,"props":5300,"children":5301},{"__ignoreMap":91},[5302],{"type":49,"value":5297},{"type":44,"tag":83,"props":5304,"children":5306},{"className":218,"code":5305,"language":220,"meta":91,"style":91},"# Push all branches\ngh stack push\n\n# Push to specific remote\ngh stack push --remote upstream\n",[5307],{"type":44,"tag":55,"props":5308,"children":5309},{"__ignoreMap":91},[5310,5318,5333,5340,5348],{"type":44,"tag":226,"props":5311,"children":5312},{"class":228,"line":229},[5313],{"type":44,"tag":226,"props":5314,"children":5315},{"style":296},[5316],{"type":49,"value":5317},"# Push all branches\n",{"type":44,"tag":226,"props":5319,"children":5320},{"class":228,"line":302},[5321,5325,5329],{"type":44,"tag":226,"props":5322,"children":5323},{"style":233},[5324],{"type":49,"value":213},{"type":44,"tag":226,"props":5326,"children":5327},{"style":238},[5328],{"type":49,"value":1238},{"type":44,"tag":226,"props":5330,"children":5331},{"style":238},[5332],{"type":49,"value":3346},{"type":44,"tag":226,"props":5334,"children":5335},{"class":228,"line":1099},[5336],{"type":44,"tag":226,"props":5337,"children":5338},{"emptyLinePlaceholder":1159},[5339],{"type":49,"value":1162},{"type":44,"tag":226,"props":5341,"children":5342},{"class":228,"line":1122},[5343],{"type":44,"tag":226,"props":5344,"children":5345},{"style":296},[5346],{"type":49,"value":5347},"# Push to specific remote\n",{"type":44,"tag":226,"props":5349,"children":5350},{"class":228,"line":1155},[5351,5355,5359,5364,5369],{"type":44,"tag":226,"props":5352,"children":5353},{"style":233},[5354],{"type":49,"value":213},{"type":44,"tag":226,"props":5356,"children":5357},{"style":238},[5358],{"type":49,"value":1238},{"type":44,"tag":226,"props":5360,"children":5361},{"style":238},[5362],{"type":49,"value":5363}," push",{"type":44,"tag":226,"props":5365,"children":5366},{"style":238},[5367],{"type":49,"value":5368}," --remote",{"type":44,"tag":226,"props":5370,"children":5371},{"style":238},[5372],{"type":49,"value":5373}," upstream\n",{"type":44,"tag":1421,"props":5375,"children":5376},{},[5377,5391],{"type":44,"tag":1425,"props":5378,"children":5379},{},[5380],{"type":44,"tag":1429,"props":5381,"children":5382},{},[5383,5387],{"type":44,"tag":1433,"props":5384,"children":5385},{},[5386],{"type":49,"value":4667},{"type":44,"tag":1433,"props":5388,"children":5389},{},[5390],{"type":49,"value":4672},{"type":44,"tag":1444,"props":5392,"children":5393},{},[5394],{"type":44,"tag":1429,"props":5395,"children":5396},{},[5397,5405],{"type":44,"tag":1451,"props":5398,"children":5399},{},[5400],{"type":44,"tag":55,"props":5401,"children":5403},{"className":5402},[],[5404],{"type":49,"value":500},{"type":44,"tag":1451,"props":5406,"children":5407},{},[5408],{"type":49,"value":5409},"Remote to push to (use if multiple remotes exist)",{"type":44,"tag":51,"props":5411,"children":5412},{},[5413],{"type":44,"tag":75,"props":5414,"children":5415},{},[5416],{"type":49,"value":4700},{"type":44,"tag":168,"props":5418,"children":5419},{},[5420,5433,5438],{"type":44,"tag":172,"props":5421,"children":5422},{},[5423,5425,5431],{"type":49,"value":5424},"Pushes all active (non-merged, non-queued) branches in one non-atomic multi-ref push with explicit per-branch ",{"type":44,"tag":55,"props":5426,"children":5428},{"className":5427},[],[5429],{"type":49,"value":5430},"--force-with-lease",{"type":49,"value":5432}," checks",{"type":44,"tag":172,"props":5434,"children":5435},{},[5436],{"type":49,"value":5437},"Some branches may update if another is rejected; fix the rejected branch and rerun the command",{"type":44,"tag":172,"props":5439,"children":5440},{},[5441,5443,5448,5450,5455],{"type":49,"value":5442},"Does ",{"type":44,"tag":75,"props":5444,"children":5445},{},[5446],{"type":49,"value":5447},"not",{"type":49,"value":5449}," create or update pull requests — use ",{"type":44,"tag":55,"props":5451,"children":5453},{"className":5452},[],[5454],{"type":49,"value":424},{"type":49,"value":5456}," for that",{"type":44,"tag":51,"props":5458,"children":5459},{},[5460],{"type":44,"tag":75,"props":5461,"children":5462},{},[5463],{"type":49,"value":5464},"Output (stderr):",{"type":44,"tag":168,"props":5466,"children":5467},{},[5468],{"type":44,"tag":172,"props":5469,"children":5470},{},[5471,5477],{"type":44,"tag":55,"props":5472,"children":5474},{"className":5473},[],[5475],{"type":49,"value":5476},"Pushed N branches",{"type":49,"value":5478}," summary",{"type":44,"tag":1967,"props":5480,"children":5481},{},[],{"type":44,"tag":943,"props":5483,"children":5485},{"id":5484},"submit-branches-and-create-prs-gh-stack-submit",[5486,5488],{"type":49,"value":5487},"Submit branches and create PRs — ",{"type":44,"tag":55,"props":5489,"children":5491},{"className":5490},[],[5492],{"type":49,"value":424},{"type":44,"tag":51,"props":5494,"children":5495},{},[5496,5498,5508,5510,5515],{"type":49,"value":5497},"Push all stack branches and create PRs on GitHub. ",{"type":44,"tag":75,"props":5499,"children":5500},{},[5501,5503],{"type":49,"value":5502},"Always pass ",{"type":44,"tag":55,"props":5504,"children":5506},{"className":5505},[],[5507],{"type":49,"value":416},{"type":49,"value":5509}," — without it, ",{"type":44,"tag":55,"props":5511,"children":5513},{"className":5512},[],[5514],{"type":49,"value":438},{"type":49,"value":5516}," prompts for a PR title for each new branch.",{"type":44,"tag":83,"props":5518,"children":5520},{"className":218,"code":5519,"language":220,"meta":91,"style":91},"# Submit and auto-title new PRs (required for non-interactive use)\ngh stack submit --auto\n\n# Submit and create PRs as ready for review (not drafts)\ngh stack submit --auto --open\n",[5521],{"type":44,"tag":55,"props":5522,"children":5523},{"__ignoreMap":91},[5524,5532,5551,5558,5566],{"type":44,"tag":226,"props":5525,"children":5526},{"class":228,"line":229},[5527],{"type":44,"tag":226,"props":5528,"children":5529},{"style":296},[5530],{"type":49,"value":5531},"# Submit and auto-title new PRs (required for non-interactive use)\n",{"type":44,"tag":226,"props":5533,"children":5534},{"class":228,"line":302},[5535,5539,5543,5547],{"type":44,"tag":226,"props":5536,"children":5537},{"style":233},[5538],{"type":49,"value":213},{"type":44,"tag":226,"props":5540,"children":5541},{"style":238},[5542],{"type":49,"value":1238},{"type":44,"tag":226,"props":5544,"children":5545},{"style":238},[5546],{"type":49,"value":2756},{"type":44,"tag":226,"props":5548,"children":5549},{"style":238},[5550],{"type":49,"value":2761},{"type":44,"tag":226,"props":5552,"children":5553},{"class":228,"line":1099},[5554],{"type":44,"tag":226,"props":5555,"children":5556},{"emptyLinePlaceholder":1159},[5557],{"type":49,"value":1162},{"type":44,"tag":226,"props":5559,"children":5560},{"class":228,"line":1122},[5561],{"type":44,"tag":226,"props":5562,"children":5563},{"style":296},[5564],{"type":49,"value":5565},"# Submit and create PRs as ready for review (not drafts)\n",{"type":44,"tag":226,"props":5567,"children":5568},{"class":228,"line":1155},[5569,5573,5577,5581,5586],{"type":44,"tag":226,"props":5570,"children":5571},{"style":233},[5572],{"type":49,"value":213},{"type":44,"tag":226,"props":5574,"children":5575},{"style":238},[5576],{"type":49,"value":1238},{"type":44,"tag":226,"props":5578,"children":5579},{"style":238},[5580],{"type":49,"value":2756},{"type":44,"tag":226,"props":5582,"children":5583},{"style":238},[5584],{"type":49,"value":5585}," --auto",{"type":44,"tag":226,"props":5587,"children":5588},{"style":238},[5589],{"type":49,"value":5590}," --open\n",{"type":44,"tag":1421,"props":5592,"children":5593},{},[5594,5608],{"type":44,"tag":1425,"props":5595,"children":5596},{},[5597],{"type":44,"tag":1429,"props":5598,"children":5599},{},[5600,5604],{"type":44,"tag":1433,"props":5601,"children":5602},{},[5603],{"type":49,"value":4667},{"type":44,"tag":1433,"props":5605,"children":5606},{},[5607],{"type":49,"value":4672},{"type":44,"tag":1444,"props":5609,"children":5610},{},[5611,5634,5651],{"type":44,"tag":1429,"props":5612,"children":5613},{},[5614,5622],{"type":44,"tag":1451,"props":5615,"children":5616},{},[5617],{"type":44,"tag":55,"props":5618,"children":5620},{"className":5619},[],[5621],{"type":49,"value":416},{"type":44,"tag":1451,"props":5623,"children":5624},{},[5625,5627,5632],{"type":49,"value":5626},"Auto-generate PR titles without prompting (",{"type":44,"tag":75,"props":5628,"children":5629},{},[5630],{"type":49,"value":5631},"required",{"type":49,"value":5633}," for non-interactive use)",{"type":44,"tag":1429,"props":5635,"children":5636},{},[5637,5646],{"type":44,"tag":1451,"props":5638,"children":5639},{},[5640],{"type":44,"tag":55,"props":5641,"children":5643},{"className":5642},[],[5644],{"type":49,"value":5645},"--open",{"type":44,"tag":1451,"props":5647,"children":5648},{},[5649],{"type":49,"value":5650},"Mark new and existing PRs as ready for review",{"type":44,"tag":1429,"props":5652,"children":5653},{},[5654,5662],{"type":44,"tag":1451,"props":5655,"children":5656},{},[5657],{"type":44,"tag":55,"props":5658,"children":5660},{"className":5659},[],[5661],{"type":49,"value":500},{"type":44,"tag":1451,"props":5663,"children":5664},{},[5665],{"type":49,"value":5409},{"type":44,"tag":51,"props":5667,"children":5668},{},[5669],{"type":44,"tag":75,"props":5670,"children":5671},{},[5672],{"type":49,"value":4700},{"type":44,"tag":168,"props":5674,"children":5675},{},[5676,5688,5693,5698,5710,5729,5741],{"type":44,"tag":172,"props":5677,"children":5678},{},[5679,5681,5686],{"type":49,"value":5680},"Pushes each active (non-merged, non-queued) branch sequentially with explicit per-branch ",{"type":44,"tag":55,"props":5682,"children":5684},{"className":5683},[],[5685],{"type":49,"value":5430},{"type":49,"value":5687}," checks; the overall submit is not atomic",{"type":44,"tag":172,"props":5689,"children":5690},{},[5691],{"type":49,"value":5692},"If a later branch push is rejected, earlier branch pushes and PR updates remain; fix the rejection and rerun the same command",{"type":44,"tag":172,"props":5694,"children":5695},{},[5696],{"type":49,"value":5697},"Creates a new PR for each branch that doesn't have one (base set to the first non-merged ancestor branch)",{"type":44,"tag":172,"props":5699,"children":5700},{},[5701,5703,5708],{"type":49,"value":5702},"After creating PRs, links them together as a ",{"type":44,"tag":75,"props":5704,"children":5705},{},[5706],{"type":49,"value":5707},"Stack",{"type":49,"value":5709}," on GitHub (requires the repository to have stacks enabled)",{"type":44,"tag":172,"props":5711,"children":5712},{},[5713,5715,5720,5722,5727],{"type":49,"value":5714},"If every PR in the stack has already been merged, the stack is complete and can't be extended. ",{"type":44,"tag":55,"props":5716,"children":5718},{"className":5717},[],[5719],{"type":49,"value":438},{"type":49,"value":5721}," automatically forks your unmerged branches into a ",{"type":44,"tag":75,"props":5723,"children":5724},{},[5725],{"type":49,"value":5726},"new",{"type":49,"value":5728}," stack rooted at the trunk and creates it on GitHub, leaving the merged stack untouched.",{"type":44,"tag":172,"props":5730,"children":5731},{},[5732,5734,5739],{"type":49,"value":5733},"If stacks are not available (exit code 9), the repository does not have stacked PRs enabled. In interactive mode, ",{"type":44,"tag":55,"props":5735,"children":5737},{"className":5736},[],[5738],{"type":49,"value":438},{"type":49,"value":5740}," offers to create regular (unstacked) PRs instead. In non-interactive mode, it exits with code 9.",{"type":44,"tag":172,"props":5742,"children":5743},{},[5744],{"type":49,"value":5745},"Syncs PR metadata for branches that already have PRs",{"type":44,"tag":51,"props":5747,"children":5748},{},[5749],{"type":44,"tag":75,"props":5750,"children":5751},{},[5752,5754,5759],{"type":49,"value":5753},"PR title auto-generation (",{"type":44,"tag":55,"props":5755,"children":5757},{"className":5756},[],[5758],{"type":49,"value":416},{"type":49,"value":5760},"):",{"type":44,"tag":168,"props":5762,"children":5763},{},[5764,5769],{"type":44,"tag":172,"props":5765,"children":5766},{},[5767],{"type":49,"value":5768},"Single commit on branch → uses the commit subject as the PR title, commit body as PR body",{"type":44,"tag":172,"props":5770,"children":5771},{},[5772],{"type":49,"value":5773},"Multiple commits on branch → humanizes the branch name (hyphens\u002Funderscores → spaces) as the title",{"type":44,"tag":51,"props":5775,"children":5776},{},[5777],{"type":44,"tag":75,"props":5778,"children":5779},{},[5780],{"type":49,"value":5464},{"type":44,"tag":168,"props":5782,"children":5783},{},[5784,5795,5806],{"type":44,"tag":172,"props":5785,"children":5786},{},[5787,5793],{"type":44,"tag":55,"props":5788,"children":5790},{"className":5789},[],[5791],{"type":49,"value":5792},"Created PR #N for \u003Cbranch>",{"type":49,"value":5794}," for each newly created PR",{"type":44,"tag":172,"props":5796,"children":5797},{},[5798,5804],{"type":44,"tag":55,"props":5799,"children":5801},{"className":5800},[],[5802],{"type":49,"value":5803},"PR #N for \u003Cbranch> is up to date",{"type":49,"value":5805}," for existing PRs",{"type":44,"tag":172,"props":5807,"children":5808},{},[5809,5815],{"type":44,"tag":55,"props":5810,"children":5812},{"className":5811},[],[5813],{"type":49,"value":5814},"Pushed and synced N branches",{"type":49,"value":5478},{"type":44,"tag":1967,"props":5817,"children":5818},{},[],{"type":44,"tag":943,"props":5820,"children":5822},{"id":5821},"link-branches-as-a-stack-no-local-tracking-gh-stack-link",[5823,5825],{"type":49,"value":5824},"Link branches as a stack (no local tracking) — ",{"type":44,"tag":55,"props":5826,"children":5828},{"className":5827},[],[5829],{"type":49,"value":697},{"type":44,"tag":51,"props":5831,"children":5832},{},[5833],{"type":49,"value":5834},"Link PRs into a stack on GitHub without creating any local tracking state. This is the recommended approach if you are managing stacked branches with other tools (jj, Sapling, git-town) and want to simply create GitHub Stacked PRs via an API.",{"type":44,"tag":83,"props":5836,"children":5839},{"className":5837,"code":5838,"language":49},[86],"gh stack link [flags] \u003Cstack-number | branch-or-pr> \u003Cbranch-or-pr> [...]\n",[5840],{"type":44,"tag":55,"props":5841,"children":5842},{"__ignoreMap":91},[5843],{"type":49,"value":5838},{"type":44,"tag":83,"props":5845,"children":5847},{"className":218,"code":5846,"language":220,"meta":91,"style":91},"# Link branches into a stack (pushes, creates PRs, creates stack)\ngh stack link branch-a branch-b branch-c\n\n# Use a different base branch and mark PRs as ready for review\ngh stack link --base develop --open branch-a branch-b branch-c\n\n# Link existing PRs by number\ngh stack link 10 20 30\n\n# Add branches to an existing stack of PRs\ngh stack link 42 43 feature-auth feature-ui\n\n# Append to the top of an existing stack by its stack number\n# (7 is a stack number; only the new PRs\u002Fbranches are listed)\ngh stack link 7 48 feature-auth\n",[5848],{"type":44,"tag":55,"props":5849,"children":5850},{"__ignoreMap":91},[5851,5859,5887,5894,5902,5942,5949,5957,5987,5994,6002,6037,6044,6052,6060],{"type":44,"tag":226,"props":5852,"children":5853},{"class":228,"line":229},[5854],{"type":44,"tag":226,"props":5855,"children":5856},{"style":296},[5857],{"type":49,"value":5858},"# Link branches into a stack (pushes, creates PRs, creates stack)\n",{"type":44,"tag":226,"props":5860,"children":5861},{"class":228,"line":302},[5862,5866,5870,5875,5879,5883],{"type":44,"tag":226,"props":5863,"children":5864},{"style":233},[5865],{"type":49,"value":213},{"type":44,"tag":226,"props":5867,"children":5868},{"style":238},[5869],{"type":49,"value":1238},{"type":44,"tag":226,"props":5871,"children":5872},{"style":238},[5873],{"type":49,"value":5874}," link",{"type":44,"tag":226,"props":5876,"children":5877},{"style":238},[5878],{"type":49,"value":4553},{"type":44,"tag":226,"props":5880,"children":5881},{"style":238},[5882],{"type":49,"value":4558},{"type":44,"tag":226,"props":5884,"children":5885},{"style":238},[5886],{"type":49,"value":4563},{"type":44,"tag":226,"props":5888,"children":5889},{"class":228,"line":1099},[5890],{"type":44,"tag":226,"props":5891,"children":5892},{"emptyLinePlaceholder":1159},[5893],{"type":49,"value":1162},{"type":44,"tag":226,"props":5895,"children":5896},{"class":228,"line":1122},[5897],{"type":44,"tag":226,"props":5898,"children":5899},{"style":296},[5900],{"type":49,"value":5901},"# Use a different base branch and mark PRs as ready for review\n",{"type":44,"tag":226,"props":5903,"children":5904},{"class":228,"line":1155},[5905,5909,5913,5917,5921,5925,5930,5934,5938],{"type":44,"tag":226,"props":5906,"children":5907},{"style":233},[5908],{"type":49,"value":213},{"type":44,"tag":226,"props":5910,"children":5911},{"style":238},[5912],{"type":49,"value":1238},{"type":44,"tag":226,"props":5914,"children":5915},{"style":238},[5916],{"type":49,"value":5874},{"type":44,"tag":226,"props":5918,"children":5919},{"style":238},[5920],{"type":49,"value":4416},{"type":44,"tag":226,"props":5922,"children":5923},{"style":238},[5924],{"type":49,"value":4602},{"type":44,"tag":226,"props":5926,"children":5927},{"style":238},[5928],{"type":49,"value":5929}," --open",{"type":44,"tag":226,"props":5931,"children":5932},{"style":238},[5933],{"type":49,"value":4553},{"type":44,"tag":226,"props":5935,"children":5936},{"style":238},[5937],{"type":49,"value":4558},{"type":44,"tag":226,"props":5939,"children":5940},{"style":238},[5941],{"type":49,"value":4563},{"type":44,"tag":226,"props":5943,"children":5944},{"class":228,"line":1165},[5945],{"type":44,"tag":226,"props":5946,"children":5947},{"emptyLinePlaceholder":1159},[5948],{"type":49,"value":1162},{"type":44,"tag":226,"props":5950,"children":5951},{"class":228,"line":1182},[5952],{"type":44,"tag":226,"props":5953,"children":5954},{"style":296},[5955],{"type":49,"value":5956},"# Link existing PRs by number\n",{"type":44,"tag":226,"props":5958,"children":5959},{"class":228,"line":1211},[5960,5964,5968,5972,5977,5982],{"type":44,"tag":226,"props":5961,"children":5962},{"style":233},[5963],{"type":49,"value":213},{"type":44,"tag":226,"props":5965,"children":5966},{"style":238},[5967],{"type":49,"value":1238},{"type":44,"tag":226,"props":5969,"children":5970},{"style":238},[5971],{"type":49,"value":5874},{"type":44,"tag":226,"props":5973,"children":5974},{"style":3999},[5975],{"type":49,"value":5976}," 10",{"type":44,"tag":226,"props":5978,"children":5979},{"style":3999},[5980],{"type":49,"value":5981}," 20",{"type":44,"tag":226,"props":5983,"children":5984},{"style":3999},[5985],{"type":49,"value":5986}," 30\n",{"type":44,"tag":226,"props":5988,"children":5989},{"class":228,"line":1219},[5990],{"type":44,"tag":226,"props":5991,"children":5992},{"emptyLinePlaceholder":1159},[5993],{"type":49,"value":1162},{"type":44,"tag":226,"props":5995,"children":5996},{"class":228,"line":1228},[5997],{"type":44,"tag":226,"props":5998,"children":5999},{"style":296},[6000],{"type":49,"value":6001},"# Add branches to an existing stack of PRs\n",{"type":44,"tag":226,"props":6003,"children":6004},{"class":228,"line":1255},[6005,6009,6013,6017,6022,6027,6032],{"type":44,"tag":226,"props":6006,"children":6007},{"style":233},[6008],{"type":49,"value":213},{"type":44,"tag":226,"props":6010,"children":6011},{"style":238},[6012],{"type":49,"value":1238},{"type":44,"tag":226,"props":6014,"children":6015},{"style":238},[6016],{"type":49,"value":5874},{"type":44,"tag":226,"props":6018,"children":6019},{"style":3999},[6020],{"type":49,"value":6021}," 42",{"type":44,"tag":226,"props":6023,"children":6024},{"style":3999},[6025],{"type":49,"value":6026}," 43",{"type":44,"tag":226,"props":6028,"children":6029},{"style":238},[6030],{"type":49,"value":6031}," feature-auth",{"type":44,"tag":226,"props":6033,"children":6034},{"style":238},[6035],{"type":49,"value":6036}," feature-ui\n",{"type":44,"tag":226,"props":6038,"children":6039},{"class":228,"line":1277},[6040],{"type":44,"tag":226,"props":6041,"children":6042},{"emptyLinePlaceholder":1159},[6043],{"type":49,"value":1162},{"type":44,"tag":226,"props":6045,"children":6046},{"class":228,"line":2118},[6047],{"type":44,"tag":226,"props":6048,"children":6049},{"style":296},[6050],{"type":49,"value":6051},"# Append to the top of an existing stack by its stack number\n",{"type":44,"tag":226,"props":6053,"children":6054},{"class":228,"line":2127},[6055],{"type":44,"tag":226,"props":6056,"children":6057},{"style":296},[6058],{"type":49,"value":6059},"# (7 is a stack number; only the new PRs\u002Fbranches are listed)\n",{"type":44,"tag":226,"props":6061,"children":6062},{"class":228,"line":2136},[6063,6067,6071,6075,6080,6085],{"type":44,"tag":226,"props":6064,"children":6065},{"style":233},[6066],{"type":49,"value":213},{"type":44,"tag":226,"props":6068,"children":6069},{"style":238},[6070],{"type":49,"value":1238},{"type":44,"tag":226,"props":6072,"children":6073},{"style":238},[6074],{"type":49,"value":5874},{"type":44,"tag":226,"props":6076,"children":6077},{"style":3999},[6078],{"type":49,"value":6079}," 7",{"type":44,"tag":226,"props":6081,"children":6082},{"style":3999},[6083],{"type":49,"value":6084}," 48",{"type":44,"tag":226,"props":6086,"children":6087},{"style":238},[6088],{"type":49,"value":6089}," feature-auth\n",{"type":44,"tag":51,"props":6091,"children":6092},{},[6093],{"type":49,"value":6094},"When the first argument is a stack number, the remaining arguments are appended to the top of that stack, so you don't have to re-list its current PRs. Arguments already in the stack are skipped; arguments in a different stack are rejected. A numeric first argument is treated as a stack only when it matches an existing stack — otherwise it is a PR or branch.",{"type":44,"tag":1421,"props":6096,"children":6097},{},[6098,6112],{"type":44,"tag":1425,"props":6099,"children":6100},{},[6101],{"type":44,"tag":1429,"props":6102,"children":6103},{},[6104,6108],{"type":44,"tag":1433,"props":6105,"children":6106},{},[6107],{"type":49,"value":4667},{"type":44,"tag":1433,"props":6109,"children":6110},{},[6111],{"type":49,"value":4672},{"type":44,"tag":1444,"props":6113,"children":6114},{},[6115,6132,6147],{"type":44,"tag":1429,"props":6116,"children":6117},{},[6118,6127],{"type":44,"tag":1451,"props":6119,"children":6120},{},[6121],{"type":44,"tag":55,"props":6122,"children":6124},{"className":6123},[],[6125],{"type":49,"value":6126},"--base \u003Cbranch>",{"type":44,"tag":1451,"props":6128,"children":6129},{},[6130],{"type":49,"value":6131},"Base branch for the bottom of the stack (defaults to the repository's default branch)",{"type":44,"tag":1429,"props":6133,"children":6134},{},[6135,6143],{"type":44,"tag":1451,"props":6136,"children":6137},{},[6138],{"type":44,"tag":55,"props":6139,"children":6141},{"className":6140},[],[6142],{"type":49,"value":5645},{"type":44,"tag":1451,"props":6144,"children":6145},{},[6146],{"type":49,"value":5650},{"type":44,"tag":1429,"props":6148,"children":6149},{},[6150,6158],{"type":44,"tag":1451,"props":6151,"children":6152},{},[6153],{"type":44,"tag":55,"props":6154,"children":6156},{"className":6155},[],[6157],{"type":49,"value":500},{"type":44,"tag":1451,"props":6159,"children":6160},{},[6161],{"type":49,"value":5409},{"type":44,"tag":51,"props":6163,"children":6164},{},[6165],{"type":44,"tag":75,"props":6166,"children":6167},{},[6168],{"type":49,"value":4700},{"type":44,"tag":168,"props":6170,"children":6171},{},[6172,6177,6182,6187,6200,6205,6210],{"type":44,"tag":172,"props":6173,"children":6174},{},[6175],{"type":49,"value":6176},"Arguments are provided in stack order (bottom to top)",{"type":44,"tag":172,"props":6178,"children":6179},{},[6180],{"type":49,"value":6181},"Each argument can be a branch name or a PR number. Numeric arguments are tried as PR numbers first; if no PR with that number exists, the argument is treated as a branch name",{"type":44,"tag":172,"props":6183,"children":6184},{},[6185],{"type":49,"value":6186},"Branch arguments are pushed to the remote automatically (non-force, atomic)",{"type":44,"tag":172,"props":6188,"children":6189},{},[6190,6192,6198],{"type":49,"value":6191},"For branches without open PRs, new PRs are created with auto-generated titles and the correct base branch chaining (first branch uses ",{"type":44,"tag":55,"props":6193,"children":6195},{"className":6194},[],[6196],{"type":49,"value":6197},"--base",{"type":49,"value":6199},", subsequent branches use the previous branch)",{"type":44,"tag":172,"props":6201,"children":6202},{},[6203],{"type":49,"value":6204},"Existing PRs whose base branch doesn't match the expected chain are corrected automatically",{"type":44,"tag":172,"props":6206,"children":6207},{},[6208],{"type":49,"value":6209},"If the PRs are not yet in a stack, a new stack is created. If some PRs are already in a stack, the stack is updated (additive only — existing PRs are never removed)",{"type":44,"tag":172,"props":6211,"children":6212},{},[6213,6214,6218],{"type":49,"value":5442},{"type":44,"tag":75,"props":6215,"children":6216},{},[6217],{"type":49,"value":5447},{"type":49,"value":6219}," create or modify any local state",{"type":44,"tag":51,"props":6221,"children":6222},{},[6223],{"type":44,"tag":75,"props":6224,"children":6225},{},[6226],{"type":49,"value":5464},{"type":44,"tag":168,"props":6228,"children":6229},{},[6230,6239,6250,6261,6272],{"type":44,"tag":172,"props":6231,"children":6232},{},[6233],{"type":44,"tag":55,"props":6234,"children":6236},{"className":6235},[],[6237],{"type":49,"value":6238},"Pushing N branches to \u003Cremote>...",{"type":44,"tag":172,"props":6240,"children":6241},{},[6242,6248],{"type":44,"tag":55,"props":6243,"children":6245},{"className":6244},[],[6246],{"type":49,"value":6247},"Found PR #N for branch \u003Cname>",{"type":49,"value":6249}," for branches with existing PRs",{"type":44,"tag":172,"props":6251,"children":6252},{},[6253,6259],{"type":44,"tag":55,"props":6254,"children":6256},{"className":6255},[],[6257],{"type":49,"value":6258},"Created PR #N for \u003Cbranch> (base: \u003Cbase>)",{"type":49,"value":6260}," for newly created PRs",{"type":44,"tag":172,"props":6262,"children":6263},{},[6264,6270],{"type":44,"tag":55,"props":6265,"children":6267},{"className":6266},[],[6268],{"type":49,"value":6269},"Updated base branch for PR #N to \u003Cbase>",{"type":49,"value":6271}," when base branches are corrected",{"type":44,"tag":172,"props":6273,"children":6274},{},[6275,6281,6282],{"type":44,"tag":55,"props":6276,"children":6278},{"className":6277},[],[6279],{"type":49,"value":6280},"Created stack with N PRs",{"type":49,"value":832},{"type":44,"tag":55,"props":6283,"children":6285},{"className":6284},[],[6286],{"type":49,"value":6287},"Updated stack to N PRs",{"type":44,"tag":1967,"props":6289,"children":6290},{},[],{"type":44,"tag":943,"props":6292,"children":6294},{"id":6293},"sync-the-stack-gh-stack-sync",[6295,6297],{"type":49,"value":6296},"Sync the stack — ",{"type":44,"tag":55,"props":6298,"children":6300},{"className":6299},[],[6301],{"type":49,"value":1633},{"type":44,"tag":51,"props":6303,"children":6304},{},[6305],{"type":49,"value":6306},"Fetch, rebase, push, and sync PR state in a single command. This is the recommended command for routine synchronization.",{"type":44,"tag":83,"props":6308,"children":6311},{"className":6309,"code":6310,"language":49},[86],"gh stack sync [flags]\n",[6312],{"type":44,"tag":55,"props":6313,"children":6314},{"__ignoreMap":91},[6315],{"type":49,"value":6310},{"type":44,"tag":1421,"props":6317,"children":6318},{},[6319,6333],{"type":44,"tag":1425,"props":6320,"children":6321},{},[6322],{"type":44,"tag":1429,"props":6323,"children":6324},{},[6325,6329],{"type":44,"tag":1433,"props":6326,"children":6327},{},[6328],{"type":49,"value":4667},{"type":44,"tag":1433,"props":6330,"children":6331},{},[6332],{"type":49,"value":4672},{"type":44,"tag":1444,"props":6334,"children":6335},{},[6336,6352],{"type":44,"tag":1429,"props":6337,"children":6338},{},[6339,6347],{"type":44,"tag":1451,"props":6340,"children":6341},{},[6342],{"type":44,"tag":55,"props":6343,"children":6345},{"className":6344},[],[6346],{"type":49,"value":500},{"type":44,"tag":1451,"props":6348,"children":6349},{},[6350],{"type":49,"value":6351},"Remote to fetch from and push to (use if multiple remotes exist)",{"type":44,"tag":1429,"props":6353,"children":6354},{},[6355,6363],{"type":44,"tag":1451,"props":6356,"children":6357},{},[6358],{"type":44,"tag":55,"props":6359,"children":6361},{"className":6360},[],[6362],{"type":49,"value":3438},{"type":44,"tag":1451,"props":6364,"children":6365},{},[6366],{"type":49,"value":6367},"Delete local branches for merged PRs",{"type":44,"tag":51,"props":6369,"children":6370},{},[6371],{"type":44,"tag":75,"props":6372,"children":6373},{},[6374],{"type":49,"value":6375},"What it does (in order):",{"type":44,"tag":351,"props":6377,"children":6378},{},[6379,6389,6399,6409,6432,6442,6452,6475],{"type":44,"tag":172,"props":6380,"children":6381},{},[6382,6387],{"type":44,"tag":75,"props":6383,"children":6384},{},[6385],{"type":49,"value":6386},"Fetch",{"type":49,"value":6388}," latest changes from the remote",{"type":44,"tag":172,"props":6390,"children":6391},{},[6392,6397],{"type":44,"tag":75,"props":6393,"children":6394},{},[6395],{"type":49,"value":6396},"Reconcile the remote stack",{"type":49,"value":6398}," — mirror the GitHub stack locally. If PRs were added to the stack on GitHub, pull their branches down and append them to the local stack. If the local and remote stacks have diverged, aborts the sync in a non-interactive terminal. In an interactive terminal, offers prompts to resolve any divergence (replace local stack with remote version, delete stack on GitHub so it can be recreated, or cancel).",{"type":44,"tag":172,"props":6400,"children":6401},{},[6402,6407],{"type":44,"tag":75,"props":6403,"children":6404},{},[6405],{"type":49,"value":6406},"Fast-forward trunk",{"type":49,"value":6408}," to match remote (skips if already up to date, warns if diverged)",{"type":44,"tag":172,"props":6410,"children":6411},{},[6412,6417,6419,6424,6426,6430],{"type":44,"tag":75,"props":6413,"children":6414},{},[6415],{"type":49,"value":6416},"Cascade rebase",{"type":49,"value":6418}," all stack branches onto their updated parents (only if trunk moved). Handles merged PRs automatically. If a conflict is detected, ",{"type":44,"tag":75,"props":6420,"children":6421},{},[6422],{"type":49,"value":6423},"all branches are restored",{"type":49,"value":6425}," to their pre-rebase state and the command exits with code 3 — see ",{"type":44,"tag":64,"props":6427,"children":6428},{"href":3634},[6429],{"type":49,"value":3637},{"type":49,"value":6431}," for the resolution workflow",{"type":44,"tag":172,"props":6433,"children":6434},{},[6435,6440],{"type":44,"tag":75,"props":6436,"children":6437},{},[6438],{"type":49,"value":6439},"Push",{"type":49,"value":6441}," all active branches atomically",{"type":44,"tag":172,"props":6443,"children":6444},{},[6445,6450],{"type":44,"tag":75,"props":6446,"children":6447},{},[6448],{"type":49,"value":6449},"Sync PR state",{"type":49,"value":6451}," from GitHub and report the status of each PR",{"type":44,"tag":172,"props":6453,"children":6454},{},[6455,6460,6462,6467,6469,6474],{"type":44,"tag":75,"props":6456,"children":6457},{},[6458],{"type":49,"value":6459},"Sync the stack object",{"type":49,"value":6461}," — link the open PRs into a stack on GitHub. If the PRs are not yet in a stack, a new stack is created; if some PRs are already in a stack, it is updated (additive only). This only happens when two or more PRs exist. Sync ",{"type":44,"tag":75,"props":6463,"children":6464},{},[6465],{"type":49,"value":6466},"never opens PRs",{"type":49,"value":6468}," — use ",{"type":44,"tag":55,"props":6470,"children":6472},{"className":6471},[],[6473],{"type":49,"value":424},{"type":49,"value":5456},{"type":44,"tag":172,"props":6476,"children":6477},{},[6478,6483,6485,6490,6492,6497],{"type":44,"tag":75,"props":6479,"children":6480},{},[6481],{"type":49,"value":6482},"Prune",{"type":49,"value":6484}," — in interactive terminals, prompts to delete local branches for merged PRs. Use ",{"type":44,"tag":55,"props":6486,"children":6488},{"className":6487},[],[6489],{"type":49,"value":3438},{"type":49,"value":6491}," to skip the prompt. In non-interactive environments, pruning only happens when ",{"type":44,"tag":55,"props":6493,"children":6495},{"className":6494},[],[6496],{"type":49,"value":3438},{"type":49,"value":6498}," is passed explicitly",{"type":44,"tag":51,"props":6500,"children":6501},{},[6502],{"type":44,"tag":75,"props":6503,"children":6504},{},[6505],{"type":49,"value":5464},{"type":44,"tag":168,"props":6507,"children":6508},{},[6509,6518,6537,6563,6574,6590,6601,6610,6621,6632,6657,6668],{"type":44,"tag":172,"props":6510,"children":6511},{},[6512],{"type":44,"tag":55,"props":6513,"children":6515},{"className":6514},[],[6516],{"type":49,"value":6517},"✓ Fetched latest changes from origin",{"type":44,"tag":172,"props":6519,"children":6520},{},[6521,6527,6529,6535],{"type":44,"tag":55,"props":6522,"children":6524},{"className":6523},[],[6525],{"type":49,"value":6526},"Pulling N new branches from the remote stack ...",{"type":49,"value":6528}," then ",{"type":44,"tag":55,"props":6530,"children":6532},{"className":6531},[],[6533],{"type":49,"value":6534},"✓ Pulled N new branches into the stack from the remote",{"type":49,"value":6536}," (when the remote stack is ahead)",{"type":44,"tag":172,"props":6538,"children":6539},{},[6540,6546,6548,6554,6555,6561],{"type":44,"tag":55,"props":6541,"children":6543},{"className":6542},[],[6544],{"type":49,"value":6545},"⚠ Your local stack has diverged from the stack on GitHub",{"type":49,"value":6547}," (with ",{"type":44,"tag":55,"props":6549,"children":6551},{"className":6550},[],[6552],{"type":49,"value":6553},"Local:",{"type":49,"value":1786},{"type":44,"tag":55,"props":6556,"children":6558},{"className":6557},[],[6559],{"type":49,"value":6560},"Remote:",{"type":49,"value":6562}," chains) when the stacks have diverged",{"type":44,"tag":172,"props":6564,"children":6565},{},[6566,6572],{"type":44,"tag":55,"props":6567,"children":6569},{"className":6568},[],[6570],{"type":49,"value":6571},"ℹ Sync aborted — no changes were made",{"type":49,"value":6573}," when a sync is cancelled",{"type":44,"tag":172,"props":6575,"children":6576},{},[6577,6583,6584],{"type":44,"tag":55,"props":6578,"children":6580},{"className":6579},[],[6581],{"type":49,"value":6582},"✓ Trunk main fast-forwarded to \u003Csha>",{"type":49,"value":832},{"type":44,"tag":55,"props":6585,"children":6587},{"className":6586},[],[6588],{"type":49,"value":6589},"✓ Trunk main is already up to date",{"type":44,"tag":172,"props":6591,"children":6592},{},[6593,6599],{"type":44,"tag":55,"props":6594,"children":6596},{"className":6595},[],[6597],{"type":49,"value":6598},"✓ Rebased \u003Cbranch> onto \u003Cbase>",{"type":49,"value":6600}," per branch (if base moved)",{"type":44,"tag":172,"props":6602,"children":6603},{},[6604],{"type":44,"tag":55,"props":6605,"children":6607},{"className":6606},[],[6608],{"type":49,"value":6609},"✓ Pushed N branches",{"type":44,"tag":172,"props":6611,"children":6612},{},[6613,6619],{"type":44,"tag":55,"props":6614,"children":6616},{"className":6615},[],[6617],{"type":49,"value":6618},"✓ PR #N (\u003Cbranch>) — Open",{"type":49,"value":6620}," per branch",{"type":44,"tag":172,"props":6622,"children":6623},{},[6624,6630],{"type":44,"tag":55,"props":6625,"children":6627},{"className":6626},[],[6628],{"type":49,"value":6629},"Merged: #N, #M",{"type":49,"value":6631}," for merged branches",{"type":44,"tag":172,"props":6633,"children":6634},{},[6635,6641,6642,6648,6649,6655],{"type":44,"tag":55,"props":6636,"children":6638},{"className":6637},[],[6639],{"type":49,"value":6640},"✓ Stack created on GitHub with N PRs",{"type":49,"value":1786},{"type":44,"tag":55,"props":6643,"children":6645},{"className":6644},[],[6646],{"type":49,"value":6647},"✓ Stack updated on GitHub with N PRs",{"type":49,"value":1786},{"type":44,"tag":55,"props":6650,"children":6652},{"className":6651},[],[6653],{"type":49,"value":6654},"✓ Linked to the existing stack on GitHub",{"type":49,"value":6656}," (when two or more PRs exist)",{"type":44,"tag":172,"props":6658,"children":6659},{},[6660,6666],{"type":44,"tag":55,"props":6661,"children":6663},{"className":6662},[],[6664],{"type":49,"value":6665},"✓ Pruned \u003Cbranch> (merged)",{"type":49,"value":6667}," per pruned branch (when pruning)",{"type":44,"tag":172,"props":6669,"children":6670},{},[6671,6677,6679,6685],{"type":44,"tag":55,"props":6672,"children":6674},{"className":6673},[],[6675],{"type":49,"value":6676},"✓ Stack synced",{"type":49,"value":6678}," when the stack object on GitHub was created\u002Fupdated to match local, or ",{"type":44,"tag":55,"props":6680,"children":6682},{"className":6681},[],[6683],{"type":49,"value":6684},"✓ Branches synced",{"type":49,"value":6686}," when only the branches were synced (fewer than two PRs or stacked PRs unavailable)",{"type":44,"tag":1967,"props":6688,"children":6689},{},[],{"type":44,"tag":943,"props":6691,"children":6693},{"id":6692},"rebase-the-stack-gh-stack-rebase",[6694,6696],{"type":49,"value":6695},"Rebase the stack — ",{"type":44,"tag":55,"props":6697,"children":6699},{"className":6698},[],[6700],{"type":49,"value":1684},{"type":44,"tag":51,"props":6702,"children":6703},{},[6704,6706,6711],{"type":49,"value":6705},"Pull from remote and cascade-rebase stack branches. Use this when ",{"type":44,"tag":55,"props":6707,"children":6709},{"className":6708},[],[6710],{"type":49,"value":521},{"type":49,"value":6712}," reports a conflict or when you need finer control (e.g., rebase only part of the stack).",{"type":44,"tag":83,"props":6714,"children":6717},{"className":6715,"code":6716,"language":49},[86],"gh stack rebase [flags] [branch]\n",[6718],{"type":44,"tag":55,"props":6719,"children":6720},{"__ignoreMap":91},[6721],{"type":49,"value":6716},{"type":44,"tag":83,"props":6723,"children":6725},{"className":218,"code":6724,"language":220,"meta":91,"style":91},"# Rebase the entire stack\ngh stack rebase\n\n# Rebase only branches from trunk to current branch\ngh stack rebase --downstack\n\n# Rebase only branches from current branch to top\ngh stack rebase --upstack\n\n# Rebase stack branches without pulling from or rebasing with trunk\ngh stack rebase --no-trunk\n\n# After resolving a conflict: stage files with `git add`, then:\ngh stack rebase --continue\n\n# Abort and restore all branches to pre-rebase state\ngh stack rebase --abort\n",[6726],{"type":44,"tag":55,"props":6727,"children":6728},{"__ignoreMap":91},[6729,6737,6752,6759,6767,6787,6794,6802,6821,6828,6836,6856,6863,6871,6890,6897,6905],{"type":44,"tag":226,"props":6730,"children":6731},{"class":228,"line":229},[6732],{"type":44,"tag":226,"props":6733,"children":6734},{"style":296},[6735],{"type":49,"value":6736},"# Rebase the entire stack\n",{"type":44,"tag":226,"props":6738,"children":6739},{"class":228,"line":302},[6740,6744,6748],{"type":44,"tag":226,"props":6741,"children":6742},{"style":233},[6743],{"type":49,"value":213},{"type":44,"tag":226,"props":6745,"children":6746},{"style":238},[6747],{"type":49,"value":1238},{"type":44,"tag":226,"props":6749,"children":6750},{"style":238},[6751],{"type":49,"value":3676},{"type":44,"tag":226,"props":6753,"children":6754},{"class":228,"line":1099},[6755],{"type":44,"tag":226,"props":6756,"children":6757},{"emptyLinePlaceholder":1159},[6758],{"type":49,"value":1162},{"type":44,"tag":226,"props":6760,"children":6761},{"class":228,"line":1122},[6762],{"type":44,"tag":226,"props":6763,"children":6764},{"style":296},[6765],{"type":49,"value":6766},"# Rebase only branches from trunk to current branch\n",{"type":44,"tag":226,"props":6768,"children":6769},{"class":228,"line":1155},[6770,6774,6778,6782],{"type":44,"tag":226,"props":6771,"children":6772},{"style":233},[6773],{"type":49,"value":213},{"type":44,"tag":226,"props":6775,"children":6776},{"style":238},[6777],{"type":49,"value":1238},{"type":44,"tag":226,"props":6779,"children":6780},{"style":238},[6781],{"type":49,"value":3051},{"type":44,"tag":226,"props":6783,"children":6784},{"style":238},[6785],{"type":49,"value":6786}," --downstack\n",{"type":44,"tag":226,"props":6788,"children":6789},{"class":228,"line":1165},[6790],{"type":44,"tag":226,"props":6791,"children":6792},{"emptyLinePlaceholder":1159},[6793],{"type":49,"value":1162},{"type":44,"tag":226,"props":6795,"children":6796},{"class":228,"line":1182},[6797],{"type":44,"tag":226,"props":6798,"children":6799},{"style":296},[6800],{"type":49,"value":6801},"# Rebase only branches from current branch to top\n",{"type":44,"tag":226,"props":6803,"children":6804},{"class":228,"line":1211},[6805,6809,6813,6817],{"type":44,"tag":226,"props":6806,"children":6807},{"style":233},[6808],{"type":49,"value":213},{"type":44,"tag":226,"props":6810,"children":6811},{"style":238},[6812],{"type":49,"value":1238},{"type":44,"tag":226,"props":6814,"children":6815},{"style":238},[6816],{"type":49,"value":3051},{"type":44,"tag":226,"props":6818,"children":6819},{"style":238},[6820],{"type":49,"value":3056},{"type":44,"tag":226,"props":6822,"children":6823},{"class":228,"line":1219},[6824],{"type":44,"tag":226,"props":6825,"children":6826},{"emptyLinePlaceholder":1159},[6827],{"type":49,"value":1162},{"type":44,"tag":226,"props":6829,"children":6830},{"class":228,"line":1228},[6831],{"type":44,"tag":226,"props":6832,"children":6833},{"style":296},[6834],{"type":49,"value":6835},"# Rebase stack branches without pulling from or rebasing with trunk\n",{"type":44,"tag":226,"props":6837,"children":6838},{"class":228,"line":1255},[6839,6843,6847,6851],{"type":44,"tag":226,"props":6840,"children":6841},{"style":233},[6842],{"type":49,"value":213},{"type":44,"tag":226,"props":6844,"children":6845},{"style":238},[6846],{"type":49,"value":1238},{"type":44,"tag":226,"props":6848,"children":6849},{"style":238},[6850],{"type":49,"value":3051},{"type":44,"tag":226,"props":6852,"children":6853},{"style":238},[6854],{"type":49,"value":6855}," --no-trunk\n",{"type":44,"tag":226,"props":6857,"children":6858},{"class":228,"line":1277},[6859],{"type":44,"tag":226,"props":6860,"children":6861},{"emptyLinePlaceholder":1159},[6862],{"type":49,"value":1162},{"type":44,"tag":226,"props":6864,"children":6865},{"class":228,"line":2118},[6866],{"type":44,"tag":226,"props":6867,"children":6868},{"style":296},[6869],{"type":49,"value":6870},"# After resolving a conflict: stage files with `git add`, then:\n",{"type":44,"tag":226,"props":6872,"children":6873},{"class":228,"line":2127},[6874,6878,6882,6886],{"type":44,"tag":226,"props":6875,"children":6876},{"style":233},[6877],{"type":49,"value":213},{"type":44,"tag":226,"props":6879,"children":6880},{"style":238},[6881],{"type":49,"value":1238},{"type":44,"tag":226,"props":6883,"children":6884},{"style":238},[6885],{"type":49,"value":3051},{"type":44,"tag":226,"props":6887,"children":6888},{"style":238},[6889],{"type":49,"value":3774},{"type":44,"tag":226,"props":6891,"children":6892},{"class":228,"line":2136},[6893],{"type":44,"tag":226,"props":6894,"children":6895},{"emptyLinePlaceholder":1159},[6896],{"type":49,"value":1162},{"type":44,"tag":226,"props":6898,"children":6899},{"class":228,"line":2145},[6900],{"type":44,"tag":226,"props":6901,"children":6902},{"style":296},[6903],{"type":49,"value":6904},"# Abort and restore all branches to pre-rebase state\n",{"type":44,"tag":226,"props":6906,"children":6907},{"class":228,"line":27},[6908,6912,6916,6920],{"type":44,"tag":226,"props":6909,"children":6910},{"style":233},[6911],{"type":49,"value":213},{"type":44,"tag":226,"props":6913,"children":6914},{"style":238},[6915],{"type":49,"value":1238},{"type":44,"tag":226,"props":6917,"children":6918},{"style":238},[6919],{"type":49,"value":3051},{"type":44,"tag":226,"props":6921,"children":6922},{"style":238},[6923],{"type":49,"value":3824},{"type":44,"tag":1421,"props":6925,"children":6926},{},[6927,6941],{"type":44,"tag":1425,"props":6928,"children":6929},{},[6930],{"type":44,"tag":1429,"props":6931,"children":6932},{},[6933,6937],{"type":44,"tag":1433,"props":6934,"children":6935},{},[6936],{"type":49,"value":4667},{"type":44,"tag":1433,"props":6938,"children":6939},{},[6940],{"type":49,"value":4672},{"type":44,"tag":1444,"props":6942,"children":6943},{},[6944,6961,6978,6995,7012,7029],{"type":44,"tag":1429,"props":6945,"children":6946},{},[6947,6956],{"type":44,"tag":1451,"props":6948,"children":6949},{},[6950],{"type":44,"tag":55,"props":6951,"children":6953},{"className":6952},[],[6954],{"type":49,"value":6955},"--downstack",{"type":44,"tag":1451,"props":6957,"children":6958},{},[6959],{"type":49,"value":6960},"Only rebase branches from trunk to the current branch",{"type":44,"tag":1429,"props":6962,"children":6963},{},[6964,6973],{"type":44,"tag":1451,"props":6965,"children":6966},{},[6967],{"type":44,"tag":55,"props":6968,"children":6970},{"className":6969},[],[6971],{"type":49,"value":6972},"--upstack",{"type":44,"tag":1451,"props":6974,"children":6975},{},[6976],{"type":49,"value":6977},"Only rebase branches from the current branch to the top",{"type":44,"tag":1429,"props":6979,"children":6980},{},[6981,6990],{"type":44,"tag":1451,"props":6982,"children":6983},{},[6984],{"type":44,"tag":55,"props":6985,"children":6987},{"className":6986},[],[6988],{"type":49,"value":6989},"--no-trunk",{"type":44,"tag":1451,"props":6991,"children":6992},{},[6993],{"type":49,"value":6994},"Skip trunk — only rebase stack branches onto each other (no fetch, no trunk rebase)",{"type":44,"tag":1429,"props":6996,"children":6997},{},[6998,7007],{"type":44,"tag":1451,"props":6999,"children":7000},{},[7001],{"type":44,"tag":55,"props":7002,"children":7004},{"className":7003},[],[7005],{"type":49,"value":7006},"--continue",{"type":44,"tag":1451,"props":7008,"children":7009},{},[7010],{"type":49,"value":7011},"Continue after resolving conflicts",{"type":44,"tag":1429,"props":7013,"children":7014},{},[7015,7024],{"type":44,"tag":1451,"props":7016,"children":7017},{},[7018],{"type":44,"tag":55,"props":7019,"children":7021},{"className":7020},[],[7022],{"type":49,"value":7023},"--abort",{"type":44,"tag":1451,"props":7025,"children":7026},{},[7027],{"type":49,"value":7028},"Abort and restore all branches",{"type":44,"tag":1429,"props":7030,"children":7031},{},[7032,7040],{"type":44,"tag":1451,"props":7033,"children":7034},{},[7035],{"type":44,"tag":55,"props":7036,"children":7038},{"className":7037},[],[7039],{"type":49,"value":500},{"type":44,"tag":1451,"props":7041,"children":7042},{},[7043],{"type":49,"value":7044},"Remote to fetch from (use if multiple remotes exist)",{"type":44,"tag":1421,"props":7046,"children":7047},{},[7048,7063],{"type":44,"tag":1425,"props":7049,"children":7050},{},[7051],{"type":44,"tag":1429,"props":7052,"children":7053},{},[7054,7059],{"type":44,"tag":1433,"props":7055,"children":7056},{},[7057],{"type":49,"value":7058},"Argument",{"type":44,"tag":1433,"props":7060,"children":7061},{},[7062],{"type":49,"value":4672},{"type":44,"tag":1444,"props":7064,"children":7065},{},[7066],{"type":44,"tag":1429,"props":7067,"children":7068},{},[7069,7078],{"type":44,"tag":1451,"props":7070,"children":7071},{},[7072],{"type":44,"tag":55,"props":7073,"children":7075},{"className":7074},[],[7076],{"type":49,"value":7077},"[branch]",{"type":44,"tag":1451,"props":7079,"children":7080},{},[7081],{"type":49,"value":7082},"Target branch (defaults to the current branch)",{"type":44,"tag":51,"props":7084,"children":7085},{},[7086,7091,7093,7097],{"type":44,"tag":75,"props":7087,"children":7088},{},[7089],{"type":49,"value":7090},"Conflict handling:",{"type":49,"value":7092}," See ",{"type":44,"tag":64,"props":7094,"children":7095},{"href":3634},[7096],{"type":49,"value":3637},{"type":49,"value":7098}," in the Workflows section for the full resolution workflow.",{"type":44,"tag":51,"props":7100,"children":7101},{},[7102,7107,7109,7115],{"type":44,"tag":75,"props":7103,"children":7104},{},[7105],{"type":49,"value":7106},"Merged PR detection:",{"type":49,"value":7108}," If a branch's PR was merged on GitHub, the rebase automatically handles this using ",{"type":44,"tag":55,"props":7110,"children":7112},{"className":7111},[],[7113],{"type":49,"value":7114},"--onto",{"type":49,"value":7116}," mode and correctly replays commits on top of the merge target.",{"type":44,"tag":51,"props":7118,"children":7119},{},[7120,7125,7126,7131,7133,7138],{"type":44,"tag":75,"props":7121,"children":7122},{},[7123],{"type":49,"value":7124},"Rerere (conflict memory):",{"type":49,"value":740},{"type":44,"tag":55,"props":7127,"children":7129},{"className":7128},[],[7130],{"type":49,"value":4734},{"type":49,"value":7132}," is enabled by ",{"type":44,"tag":55,"props":7134,"children":7136},{"className":7135},[],[7137],{"type":49,"value":369},{"type":49,"value":7139}," so previously resolved conflicts are auto-resolved in future rebases.",{"type":44,"tag":51,"props":7141,"children":7142},{},[7143,7148,7150,7155],{"type":44,"tag":75,"props":7144,"children":7145},{},[7146],{"type":49,"value":7147},"No-trunk mode:",{"type":49,"value":7149}," Use ",{"type":44,"tag":55,"props":7151,"children":7153},{"className":7152},[],[7154],{"type":49,"value":6989},{"type":49,"value":7156}," to skip fetching from the remote and rebasing with the trunk branch. Only inter-branch rebases are performed (branch 2 onto branch 1, branch 3 onto branch 2, etc.). Useful when you only need to align stack branches with each other without pulling upstream changes.",{"type":44,"tag":1967,"props":7158,"children":7159},{},[],{"type":44,"tag":943,"props":7161,"children":7163},{"id":7162},"view-the-stack-gh-stack-view",[7164,7166],{"type":49,"value":7165},"View the stack — ",{"type":44,"tag":55,"props":7167,"children":7169},{"className":7168},[],[7170],{"type":49,"value":460},{"type":44,"tag":51,"props":7172,"children":7173},{},[7174,7176,7185],{"type":49,"value":7175},"Display the current stack's branches, PR status, and recent commits. ",{"type":44,"tag":75,"props":7177,"children":7178},{},[7179,7180],{"type":49,"value":5502},{"type":44,"tag":55,"props":7181,"children":7183},{"className":7182},[],[7184],{"type":49,"value":453},{"type":49,"value":7186}," — without it, this command launches an interactive TUI that agents cannot operate.",{"type":44,"tag":83,"props":7188,"children":7190},{"className":218,"code":7189,"language":220,"meta":91,"style":91},"# Always use --json\ngh stack view --json\n",[7191],{"type":44,"tag":55,"props":7192,"children":7193},{"__ignoreMap":91},[7194,7202],{"type":44,"tag":226,"props":7195,"children":7196},{"class":228,"line":229},[7197],{"type":44,"tag":226,"props":7198,"children":7199},{"style":296},[7200],{"type":49,"value":7201},"# Always use --json\n",{"type":44,"tag":226,"props":7203,"children":7204},{"class":228,"line":302},[7205,7209,7213,7217],{"type":44,"tag":226,"props":7206,"children":7207},{"style":233},[7208],{"type":49,"value":213},{"type":44,"tag":226,"props":7210,"children":7211},{"style":238},[7212],{"type":49,"value":1238},{"type":44,"tag":226,"props":7214,"children":7215},{"style":238},[7216],{"type":49,"value":2795},{"type":44,"tag":226,"props":7218,"children":7219},{"style":238},[7220],{"type":49,"value":2800},{"type":44,"tag":1421,"props":7222,"children":7223},{},[7224,7238],{"type":44,"tag":1425,"props":7225,"children":7226},{},[7227],{"type":44,"tag":1429,"props":7228,"children":7229},{},[7230,7234],{"type":44,"tag":1433,"props":7231,"children":7232},{},[7233],{"type":49,"value":4667},{"type":44,"tag":1433,"props":7235,"children":7236},{},[7237],{"type":49,"value":4672},{"type":44,"tag":1444,"props":7239,"children":7240},{},[7241],{"type":44,"tag":1429,"props":7242,"children":7243},{},[7244,7252],{"type":44,"tag":1451,"props":7245,"children":7246},{},[7247],{"type":44,"tag":55,"props":7248,"children":7250},{"className":7249},[],[7251],{"type":49,"value":453},{"type":44,"tag":1451,"props":7253,"children":7254},{},[7255,7257,7261],{"type":49,"value":7256},"Output stack data as JSON to stdout (",{"type":44,"tag":75,"props":7258,"children":7259},{},[7260],{"type":49,"value":5631},{"type":49,"value":5633},{"type":44,"tag":51,"props":7263,"children":7264},{},[7265],{"type":44,"tag":75,"props":7266,"children":7267},{},[7268,7273],{"type":44,"tag":55,"props":7269,"children":7271},{"className":7270},[],[7272],{"type":49,"value":453},{"type":49,"value":7274}," output format:",{"type":44,"tag":83,"props":7276,"children":7280},{"className":7277,"code":7278,"language":7279,"meta":91,"style":91},"language-json shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","{\n  \"trunk\": \"main\",\n  \"currentBranch\": \"api-routes\",\n  \"branches\": [\n    {\n      \"name\": \"auth\",\n      \"head\": \"abc1234...\",\n      \"base\": \"def5678...\",\n      \"isCurrent\": false,\n      \"isMerged\": true,\n      \"isQueued\": false,\n      \"needsRebase\": false,\n      \"pr\": {\n        \"number\": 42,\n        \"url\": \"https:\u002F\u002Fgithub.com\u002Fowner\u002Frepo\u002Fpull\u002F42\",\n        \"state\": \"MERGED\"\n      }\n    },\n    {\n      \"name\": \"api-routes\",\n      \"head\": \"789abcd...\",\n      \"base\": \"abc1234...\",\n      \"isCurrent\": true,\n      \"isMerged\": false,\n      \"isQueued\": false,\n      \"needsRebase\": false,\n      \"pr\": {\n        \"number\": 43,\n        \"url\": \"https:\u002F\u002Fgithub.com\u002Fowner\u002Frepo\u002Fpull\u002F43\",\n        \"state\": \"OPEN\"\n      }\n    }\n  ]\n}\n","json",[7281],{"type":44,"tag":55,"props":7282,"children":7283},{"__ignoreMap":91},[7284,7292,7332,7368,7393,7401,7438,7475,7512,7537,7562,7586,7610,7635,7664,7701,7734,7742,7750,7757,7792,7828,7863,7886,7909,7932,7955,7978,8005,8041,8073,8080,8088,8096],{"type":44,"tag":226,"props":7285,"children":7286},{"class":228,"line":229},[7287],{"type":44,"tag":226,"props":7288,"children":7289},{"style":290},[7290],{"type":49,"value":7291},"{\n",{"type":44,"tag":226,"props":7293,"children":7294},{"class":228,"line":302},[7295,7300,7305,7309,7314,7318,7323,7327],{"type":44,"tag":226,"props":7296,"children":7297},{"style":290},[7298],{"type":49,"value":7299},"  \"",{"type":44,"tag":226,"props":7301,"children":7303},{"style":7302},"--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA",[7304],{"type":49,"value":556},{"type":44,"tag":226,"props":7306,"children":7307},{"style":290},[7308],{"type":49,"value":3935},{"type":44,"tag":226,"props":7310,"children":7311},{"style":290},[7312],{"type":49,"value":7313},":",{"type":44,"tag":226,"props":7315,"children":7316},{"style":290},[7317],{"type":49,"value":1142},{"type":44,"tag":226,"props":7319,"children":7320},{"style":238},[7321],{"type":49,"value":7322},"main",{"type":44,"tag":226,"props":7324,"children":7325},{"style":290},[7326],{"type":49,"value":3935},{"type":44,"tag":226,"props":7328,"children":7329},{"style":290},[7330],{"type":49,"value":7331},",\n",{"type":44,"tag":226,"props":7333,"children":7334},{"class":228,"line":1099},[7335,7339,7344,7348,7352,7356,7360,7364],{"type":44,"tag":226,"props":7336,"children":7337},{"style":290},[7338],{"type":49,"value":7299},{"type":44,"tag":226,"props":7340,"children":7341},{"style":7302},[7342],{"type":49,"value":7343},"currentBranch",{"type":44,"tag":226,"props":7345,"children":7346},{"style":290},[7347],{"type":49,"value":3935},{"type":44,"tag":226,"props":7349,"children":7350},{"style":290},[7351],{"type":49,"value":7313},{"type":44,"tag":226,"props":7353,"children":7354},{"style":290},[7355],{"type":49,"value":1142},{"type":44,"tag":226,"props":7357,"children":7358},{"style":238},[7359],{"type":49,"value":1008},{"type":44,"tag":226,"props":7361,"children":7362},{"style":290},[7363],{"type":49,"value":3935},{"type":44,"tag":226,"props":7365,"children":7366},{"style":290},[7367],{"type":49,"value":7331},{"type":44,"tag":226,"props":7369,"children":7370},{"class":228,"line":1122},[7371,7375,7380,7384,7388],{"type":44,"tag":226,"props":7372,"children":7373},{"style":290},[7374],{"type":49,"value":7299},{"type":44,"tag":226,"props":7376,"children":7377},{"style":7302},[7378],{"type":49,"value":7379},"branches",{"type":44,"tag":226,"props":7381,"children":7382},{"style":290},[7383],{"type":49,"value":3935},{"type":44,"tag":226,"props":7385,"children":7386},{"style":290},[7387],{"type":49,"value":7313},{"type":44,"tag":226,"props":7389,"children":7390},{"style":290},[7391],{"type":49,"value":7392}," [\n",{"type":44,"tag":226,"props":7394,"children":7395},{"class":228,"line":1155},[7396],{"type":44,"tag":226,"props":7397,"children":7398},{"style":290},[7399],{"type":49,"value":7400},"    {\n",{"type":44,"tag":226,"props":7402,"children":7403},{"class":228,"line":1165},[7404,7409,7414,7418,7422,7426,7430,7434],{"type":44,"tag":226,"props":7405,"children":7406},{"style":290},[7407],{"type":49,"value":7408},"      \"",{"type":44,"tag":226,"props":7410,"children":7411},{"style":233},[7412],{"type":49,"value":7413},"name",{"type":44,"tag":226,"props":7415,"children":7416},{"style":290},[7417],{"type":49,"value":3935},{"type":44,"tag":226,"props":7419,"children":7420},{"style":290},[7421],{"type":49,"value":7313},{"type":44,"tag":226,"props":7423,"children":7424},{"style":290},[7425],{"type":49,"value":1142},{"type":44,"tag":226,"props":7427,"children":7428},{"style":238},[7429],{"type":49,"value":1001},{"type":44,"tag":226,"props":7431,"children":7432},{"style":290},[7433],{"type":49,"value":3935},{"type":44,"tag":226,"props":7435,"children":7436},{"style":290},[7437],{"type":49,"value":7331},{"type":44,"tag":226,"props":7439,"children":7440},{"class":228,"line":1182},[7441,7445,7450,7454,7458,7462,7467,7471],{"type":44,"tag":226,"props":7442,"children":7443},{"style":290},[7444],{"type":49,"value":7408},{"type":44,"tag":226,"props":7446,"children":7447},{"style":233},[7448],{"type":49,"value":7449},"head",{"type":44,"tag":226,"props":7451,"children":7452},{"style":290},[7453],{"type":49,"value":3935},{"type":44,"tag":226,"props":7455,"children":7456},{"style":290},[7457],{"type":49,"value":7313},{"type":44,"tag":226,"props":7459,"children":7460},{"style":290},[7461],{"type":49,"value":1142},{"type":44,"tag":226,"props":7463,"children":7464},{"style":238},[7465],{"type":49,"value":7466},"abc1234...",{"type":44,"tag":226,"props":7468,"children":7469},{"style":290},[7470],{"type":49,"value":3935},{"type":44,"tag":226,"props":7472,"children":7473},{"style":290},[7474],{"type":49,"value":7331},{"type":44,"tag":226,"props":7476,"children":7477},{"class":228,"line":1211},[7478,7482,7487,7491,7495,7499,7504,7508],{"type":44,"tag":226,"props":7479,"children":7480},{"style":290},[7481],{"type":49,"value":7408},{"type":44,"tag":226,"props":7483,"children":7484},{"style":233},[7485],{"type":49,"value":7486},"base",{"type":44,"tag":226,"props":7488,"children":7489},{"style":290},[7490],{"type":49,"value":3935},{"type":44,"tag":226,"props":7492,"children":7493},{"style":290},[7494],{"type":49,"value":7313},{"type":44,"tag":226,"props":7496,"children":7497},{"style":290},[7498],{"type":49,"value":1142},{"type":44,"tag":226,"props":7500,"children":7501},{"style":238},[7502],{"type":49,"value":7503},"def5678...",{"type":44,"tag":226,"props":7505,"children":7506},{"style":290},[7507],{"type":49,"value":3935},{"type":44,"tag":226,"props":7509,"children":7510},{"style":290},[7511],{"type":49,"value":7331},{"type":44,"tag":226,"props":7513,"children":7514},{"class":228,"line":1219},[7515,7519,7524,7528,7532],{"type":44,"tag":226,"props":7516,"children":7517},{"style":290},[7518],{"type":49,"value":7408},{"type":44,"tag":226,"props":7520,"children":7521},{"style":233},[7522],{"type":49,"value":7523},"isCurrent",{"type":44,"tag":226,"props":7525,"children":7526},{"style":290},[7527],{"type":49,"value":3935},{"type":44,"tag":226,"props":7529,"children":7530},{"style":290},[7531],{"type":49,"value":7313},{"type":44,"tag":226,"props":7533,"children":7534},{"style":290},[7535],{"type":49,"value":7536}," false,\n",{"type":44,"tag":226,"props":7538,"children":7539},{"class":228,"line":1228},[7540,7544,7549,7553,7557],{"type":44,"tag":226,"props":7541,"children":7542},{"style":290},[7543],{"type":49,"value":7408},{"type":44,"tag":226,"props":7545,"children":7546},{"style":233},[7547],{"type":49,"value":7548},"isMerged",{"type":44,"tag":226,"props":7550,"children":7551},{"style":290},[7552],{"type":49,"value":3935},{"type":44,"tag":226,"props":7554,"children":7555},{"style":290},[7556],{"type":49,"value":7313},{"type":44,"tag":226,"props":7558,"children":7559},{"style":290},[7560],{"type":49,"value":7561}," true,\n",{"type":44,"tag":226,"props":7563,"children":7564},{"class":228,"line":1255},[7565,7569,7574,7578,7582],{"type":44,"tag":226,"props":7566,"children":7567},{"style":290},[7568],{"type":49,"value":7408},{"type":44,"tag":226,"props":7570,"children":7571},{"style":233},[7572],{"type":49,"value":7573},"isQueued",{"type":44,"tag":226,"props":7575,"children":7576},{"style":290},[7577],{"type":49,"value":3935},{"type":44,"tag":226,"props":7579,"children":7580},{"style":290},[7581],{"type":49,"value":7313},{"type":44,"tag":226,"props":7583,"children":7584},{"style":290},[7585],{"type":49,"value":7536},{"type":44,"tag":226,"props":7587,"children":7588},{"class":228,"line":1277},[7589,7593,7598,7602,7606],{"type":44,"tag":226,"props":7590,"children":7591},{"style":290},[7592],{"type":49,"value":7408},{"type":44,"tag":226,"props":7594,"children":7595},{"style":233},[7596],{"type":49,"value":7597},"needsRebase",{"type":44,"tag":226,"props":7599,"children":7600},{"style":290},[7601],{"type":49,"value":3935},{"type":44,"tag":226,"props":7603,"children":7604},{"style":290},[7605],{"type":49,"value":7313},{"type":44,"tag":226,"props":7607,"children":7608},{"style":290},[7609],{"type":49,"value":7536},{"type":44,"tag":226,"props":7611,"children":7612},{"class":228,"line":2118},[7613,7617,7622,7626,7630],{"type":44,"tag":226,"props":7614,"children":7615},{"style":290},[7616],{"type":49,"value":7408},{"type":44,"tag":226,"props":7618,"children":7619},{"style":233},[7620],{"type":49,"value":7621},"pr",{"type":44,"tag":226,"props":7623,"children":7624},{"style":290},[7625],{"type":49,"value":3935},{"type":44,"tag":226,"props":7627,"children":7628},{"style":290},[7629],{"type":49,"value":7313},{"type":44,"tag":226,"props":7631,"children":7632},{"style":290},[7633],{"type":49,"value":7634}," {\n",{"type":44,"tag":226,"props":7636,"children":7637},{"class":228,"line":2127},[7638,7643,7648,7652,7656,7660],{"type":44,"tag":226,"props":7639,"children":7640},{"style":290},[7641],{"type":49,"value":7642},"        \"",{"type":44,"tag":226,"props":7644,"children":7645},{"style":3999},[7646],{"type":49,"value":7647},"number",{"type":44,"tag":226,"props":7649,"children":7650},{"style":290},[7651],{"type":49,"value":3935},{"type":44,"tag":226,"props":7653,"children":7654},{"style":290},[7655],{"type":49,"value":7313},{"type":44,"tag":226,"props":7657,"children":7658},{"style":3999},[7659],{"type":49,"value":6021},{"type":44,"tag":226,"props":7661,"children":7662},{"style":290},[7663],{"type":49,"value":7331},{"type":44,"tag":226,"props":7665,"children":7666},{"class":228,"line":2136},[7667,7671,7676,7680,7684,7688,7693,7697],{"type":44,"tag":226,"props":7668,"children":7669},{"style":290},[7670],{"type":49,"value":7642},{"type":44,"tag":226,"props":7672,"children":7673},{"style":3999},[7674],{"type":49,"value":7675},"url",{"type":44,"tag":226,"props":7677,"children":7678},{"style":290},[7679],{"type":49,"value":3935},{"type":44,"tag":226,"props":7681,"children":7682},{"style":290},[7683],{"type":49,"value":7313},{"type":44,"tag":226,"props":7685,"children":7686},{"style":290},[7687],{"type":49,"value":1142},{"type":44,"tag":226,"props":7689,"children":7690},{"style":238},[7691],{"type":49,"value":7692},"https:\u002F\u002Fgithub.com\u002Fowner\u002Frepo\u002Fpull\u002F42",{"type":44,"tag":226,"props":7694,"children":7695},{"style":290},[7696],{"type":49,"value":3935},{"type":44,"tag":226,"props":7698,"children":7699},{"style":290},[7700],{"type":49,"value":7331},{"type":44,"tag":226,"props":7702,"children":7703},{"class":228,"line":2145},[7704,7708,7713,7717,7721,7725,7730],{"type":44,"tag":226,"props":7705,"children":7706},{"style":290},[7707],{"type":49,"value":7642},{"type":44,"tag":226,"props":7709,"children":7710},{"style":3999},[7711],{"type":49,"value":7712},"state",{"type":44,"tag":226,"props":7714,"children":7715},{"style":290},[7716],{"type":49,"value":3935},{"type":44,"tag":226,"props":7718,"children":7719},{"style":290},[7720],{"type":49,"value":7313},{"type":44,"tag":226,"props":7722,"children":7723},{"style":290},[7724],{"type":49,"value":1142},{"type":44,"tag":226,"props":7726,"children":7727},{"style":238},[7728],{"type":49,"value":7729},"MERGED",{"type":44,"tag":226,"props":7731,"children":7732},{"style":290},[7733],{"type":49,"value":1152},{"type":44,"tag":226,"props":7735,"children":7736},{"class":228,"line":27},[7737],{"type":44,"tag":226,"props":7738,"children":7739},{"style":290},[7740],{"type":49,"value":7741},"      }\n",{"type":44,"tag":226,"props":7743,"children":7744},{"class":228,"line":2161},[7745],{"type":44,"tag":226,"props":7746,"children":7747},{"style":290},[7748],{"type":49,"value":7749},"    },\n",{"type":44,"tag":226,"props":7751,"children":7752},{"class":228,"line":2178},[7753],{"type":44,"tag":226,"props":7754,"children":7755},{"style":290},[7756],{"type":49,"value":7400},{"type":44,"tag":226,"props":7758,"children":7759},{"class":228,"line":2207},[7760,7764,7768,7772,7776,7780,7784,7788],{"type":44,"tag":226,"props":7761,"children":7762},{"style":290},[7763],{"type":49,"value":7408},{"type":44,"tag":226,"props":7765,"children":7766},{"style":233},[7767],{"type":49,"value":7413},{"type":44,"tag":226,"props":7769,"children":7770},{"style":290},[7771],{"type":49,"value":3935},{"type":44,"tag":226,"props":7773,"children":7774},{"style":290},[7775],{"type":49,"value":7313},{"type":44,"tag":226,"props":7777,"children":7778},{"style":290},[7779],{"type":49,"value":1142},{"type":44,"tag":226,"props":7781,"children":7782},{"style":238},[7783],{"type":49,"value":1008},{"type":44,"tag":226,"props":7785,"children":7786},{"style":290},[7787],{"type":49,"value":3935},{"type":44,"tag":226,"props":7789,"children":7790},{"style":290},[7791],{"type":49,"value":7331},{"type":44,"tag":226,"props":7793,"children":7794},{"class":228,"line":2215},[7795,7799,7803,7807,7811,7815,7820,7824],{"type":44,"tag":226,"props":7796,"children":7797},{"style":290},[7798],{"type":49,"value":7408},{"type":44,"tag":226,"props":7800,"children":7801},{"style":233},[7802],{"type":49,"value":7449},{"type":44,"tag":226,"props":7804,"children":7805},{"style":290},[7806],{"type":49,"value":3935},{"type":44,"tag":226,"props":7808,"children":7809},{"style":290},[7810],{"type":49,"value":7313},{"type":44,"tag":226,"props":7812,"children":7813},{"style":290},[7814],{"type":49,"value":1142},{"type":44,"tag":226,"props":7816,"children":7817},{"style":238},[7818],{"type":49,"value":7819},"789abcd...",{"type":44,"tag":226,"props":7821,"children":7822},{"style":290},[7823],{"type":49,"value":3935},{"type":44,"tag":226,"props":7825,"children":7826},{"style":290},[7827],{"type":49,"value":7331},{"type":44,"tag":226,"props":7829,"children":7830},{"class":228,"line":2224},[7831,7835,7839,7843,7847,7851,7855,7859],{"type":44,"tag":226,"props":7832,"children":7833},{"style":290},[7834],{"type":49,"value":7408},{"type":44,"tag":226,"props":7836,"children":7837},{"style":233},[7838],{"type":49,"value":7486},{"type":44,"tag":226,"props":7840,"children":7841},{"style":290},[7842],{"type":49,"value":3935},{"type":44,"tag":226,"props":7844,"children":7845},{"style":290},[7846],{"type":49,"value":7313},{"type":44,"tag":226,"props":7848,"children":7849},{"style":290},[7850],{"type":49,"value":1142},{"type":44,"tag":226,"props":7852,"children":7853},{"style":238},[7854],{"type":49,"value":7466},{"type":44,"tag":226,"props":7856,"children":7857},{"style":290},[7858],{"type":49,"value":3935},{"type":44,"tag":226,"props":7860,"children":7861},{"style":290},[7862],{"type":49,"value":7331},{"type":44,"tag":226,"props":7864,"children":7865},{"class":228,"line":2249},[7866,7870,7874,7878,7882],{"type":44,"tag":226,"props":7867,"children":7868},{"style":290},[7869],{"type":49,"value":7408},{"type":44,"tag":226,"props":7871,"children":7872},{"style":233},[7873],{"type":49,"value":7523},{"type":44,"tag":226,"props":7875,"children":7876},{"style":290},[7877],{"type":49,"value":3935},{"type":44,"tag":226,"props":7879,"children":7880},{"style":290},[7881],{"type":49,"value":7313},{"type":44,"tag":226,"props":7883,"children":7884},{"style":290},[7885],{"type":49,"value":7561},{"type":44,"tag":226,"props":7887,"children":7888},{"class":228,"line":2257},[7889,7893,7897,7901,7905],{"type":44,"tag":226,"props":7890,"children":7891},{"style":290},[7892],{"type":49,"value":7408},{"type":44,"tag":226,"props":7894,"children":7895},{"style":233},[7896],{"type":49,"value":7548},{"type":44,"tag":226,"props":7898,"children":7899},{"style":290},[7900],{"type":49,"value":3935},{"type":44,"tag":226,"props":7902,"children":7903},{"style":290},[7904],{"type":49,"value":7313},{"type":44,"tag":226,"props":7906,"children":7907},{"style":290},[7908],{"type":49,"value":7536},{"type":44,"tag":226,"props":7910,"children":7911},{"class":228,"line":2265},[7912,7916,7920,7924,7928],{"type":44,"tag":226,"props":7913,"children":7914},{"style":290},[7915],{"type":49,"value":7408},{"type":44,"tag":226,"props":7917,"children":7918},{"style":233},[7919],{"type":49,"value":7573},{"type":44,"tag":226,"props":7921,"children":7922},{"style":290},[7923],{"type":49,"value":3935},{"type":44,"tag":226,"props":7925,"children":7926},{"style":290},[7927],{"type":49,"value":7313},{"type":44,"tag":226,"props":7929,"children":7930},{"style":290},[7931],{"type":49,"value":7536},{"type":44,"tag":226,"props":7933,"children":7934},{"class":228,"line":2274},[7935,7939,7943,7947,7951],{"type":44,"tag":226,"props":7936,"children":7937},{"style":290},[7938],{"type":49,"value":7408},{"type":44,"tag":226,"props":7940,"children":7941},{"style":233},[7942],{"type":49,"value":7597},{"type":44,"tag":226,"props":7944,"children":7945},{"style":290},[7946],{"type":49,"value":3935},{"type":44,"tag":226,"props":7948,"children":7949},{"style":290},[7950],{"type":49,"value":7313},{"type":44,"tag":226,"props":7952,"children":7953},{"style":290},[7954],{"type":49,"value":7536},{"type":44,"tag":226,"props":7956,"children":7957},{"class":228,"line":2283},[7958,7962,7966,7970,7974],{"type":44,"tag":226,"props":7959,"children":7960},{"style":290},[7961],{"type":49,"value":7408},{"type":44,"tag":226,"props":7963,"children":7964},{"style":233},[7965],{"type":49,"value":7621},{"type":44,"tag":226,"props":7967,"children":7968},{"style":290},[7969],{"type":49,"value":3935},{"type":44,"tag":226,"props":7971,"children":7972},{"style":290},[7973],{"type":49,"value":7313},{"type":44,"tag":226,"props":7975,"children":7976},{"style":290},[7977],{"type":49,"value":7634},{"type":44,"tag":226,"props":7979,"children":7980},{"class":228,"line":2291},[7981,7985,7989,7993,7997,8001],{"type":44,"tag":226,"props":7982,"children":7983},{"style":290},[7984],{"type":49,"value":7642},{"type":44,"tag":226,"props":7986,"children":7987},{"style":3999},[7988],{"type":49,"value":7647},{"type":44,"tag":226,"props":7990,"children":7991},{"style":290},[7992],{"type":49,"value":3935},{"type":44,"tag":226,"props":7994,"children":7995},{"style":290},[7996],{"type":49,"value":7313},{"type":44,"tag":226,"props":7998,"children":7999},{"style":3999},[8000],{"type":49,"value":6026},{"type":44,"tag":226,"props":8002,"children":8003},{"style":290},[8004],{"type":49,"value":7331},{"type":44,"tag":226,"props":8006,"children":8007},{"class":228,"line":2299},[8008,8012,8016,8020,8024,8028,8033,8037],{"type":44,"tag":226,"props":8009,"children":8010},{"style":290},[8011],{"type":49,"value":7642},{"type":44,"tag":226,"props":8013,"children":8014},{"style":3999},[8015],{"type":49,"value":7675},{"type":44,"tag":226,"props":8017,"children":8018},{"style":290},[8019],{"type":49,"value":3935},{"type":44,"tag":226,"props":8021,"children":8022},{"style":290},[8023],{"type":49,"value":7313},{"type":44,"tag":226,"props":8025,"children":8026},{"style":290},[8027],{"type":49,"value":1142},{"type":44,"tag":226,"props":8029,"children":8030},{"style":238},[8031],{"type":49,"value":8032},"https:\u002F\u002Fgithub.com\u002Fowner\u002Frepo\u002Fpull\u002F43",{"type":44,"tag":226,"props":8034,"children":8035},{"style":290},[8036],{"type":49,"value":3935},{"type":44,"tag":226,"props":8038,"children":8039},{"style":290},[8040],{"type":49,"value":7331},{"type":44,"tag":226,"props":8042,"children":8043},{"class":228,"line":2316},[8044,8048,8052,8056,8060,8064,8069],{"type":44,"tag":226,"props":8045,"children":8046},{"style":290},[8047],{"type":49,"value":7642},{"type":44,"tag":226,"props":8049,"children":8050},{"style":3999},[8051],{"type":49,"value":7712},{"type":44,"tag":226,"props":8053,"children":8054},{"style":290},[8055],{"type":49,"value":3935},{"type":44,"tag":226,"props":8057,"children":8058},{"style":290},[8059],{"type":49,"value":7313},{"type":44,"tag":226,"props":8061,"children":8062},{"style":290},[8063],{"type":49,"value":1142},{"type":44,"tag":226,"props":8065,"children":8066},{"style":238},[8067],{"type":49,"value":8068},"OPEN",{"type":44,"tag":226,"props":8070,"children":8071},{"style":290},[8072],{"type":49,"value":1152},{"type":44,"tag":226,"props":8074,"children":8075},{"class":228,"line":2345},[8076],{"type":44,"tag":226,"props":8077,"children":8078},{"style":290},[8079],{"type":49,"value":7741},{"type":44,"tag":226,"props":8081,"children":8082},{"class":228,"line":2353},[8083],{"type":44,"tag":226,"props":8084,"children":8085},{"style":290},[8086],{"type":49,"value":8087},"    }\n",{"type":44,"tag":226,"props":8089,"children":8090},{"class":228,"line":2362},[8091],{"type":44,"tag":226,"props":8092,"children":8093},{"style":290},[8094],{"type":49,"value":8095},"  ]\n",{"type":44,"tag":226,"props":8097,"children":8098},{"class":228,"line":2383},[8099],{"type":44,"tag":226,"props":8100,"children":8101},{"style":290},[8102],{"type":49,"value":2133},{"type":44,"tag":51,"props":8104,"children":8105},{},[8106],{"type":49,"value":8107},"Fields per branch:",{"type":44,"tag":168,"props":8109,"children":8110},{},[8111,8121,8131,8141,8151,8161,8171,8181],{"type":44,"tag":172,"props":8112,"children":8113},{},[8114,8119],{"type":44,"tag":55,"props":8115,"children":8117},{"className":8116},[],[8118],{"type":49,"value":7413},{"type":49,"value":8120}," — branch name",{"type":44,"tag":172,"props":8122,"children":8123},{},[8124,8129],{"type":44,"tag":55,"props":8125,"children":8127},{"className":8126},[],[8128],{"type":49,"value":7449},{"type":49,"value":8130}," — current HEAD SHA",{"type":44,"tag":172,"props":8132,"children":8133},{},[8134,8139],{"type":44,"tag":55,"props":8135,"children":8137},{"className":8136},[],[8138],{"type":49,"value":7486},{"type":49,"value":8140}," — parent branch's HEAD SHA at last sync",{"type":44,"tag":172,"props":8142,"children":8143},{},[8144,8149],{"type":44,"tag":55,"props":8145,"children":8147},{"className":8146},[],[8148],{"type":49,"value":7523},{"type":49,"value":8150}," — whether this is the checked-out branch",{"type":44,"tag":172,"props":8152,"children":8153},{},[8154,8159],{"type":44,"tag":55,"props":8155,"children":8157},{"className":8156},[],[8158],{"type":49,"value":7548},{"type":49,"value":8160}," — whether the PR has been merged",{"type":44,"tag":172,"props":8162,"children":8163},{},[8164,8169],{"type":44,"tag":55,"props":8165,"children":8167},{"className":8166},[],[8168],{"type":49,"value":7573},{"type":49,"value":8170}," — whether the PR is queued for merge (in a merge queue)",{"type":44,"tag":172,"props":8172,"children":8173},{},[8174,8179],{"type":44,"tag":55,"props":8175,"children":8177},{"className":8176},[],[8178],{"type":49,"value":7597},{"type":49,"value":8180}," — whether the base branch is not an ancestor (non-linear history)",{"type":44,"tag":172,"props":8182,"children":8183},{},[8184,8189,8191,8196,8198,8204,8205,8211,8212,8218],{"type":44,"tag":55,"props":8185,"children":8187},{"className":8186},[],[8188],{"type":49,"value":7621},{"type":49,"value":8190}," — PR metadata (omitted if no PR exists). ",{"type":44,"tag":55,"props":8192,"children":8194},{"className":8193},[],[8195],{"type":49,"value":7712},{"type":49,"value":8197}," is ",{"type":44,"tag":55,"props":8199,"children":8201},{"className":8200},[],[8202],{"type":49,"value":8203},"\"OPEN\"",{"type":49,"value":120},{"type":44,"tag":55,"props":8206,"children":8208},{"className":8207},[],[8209],{"type":49,"value":8210},"\"MERGED\"",{"type":49,"value":667},{"type":44,"tag":55,"props":8213,"children":8215},{"className":8214},[],[8216],{"type":49,"value":8217},"\"QUEUED\"",{"type":49,"value":402},{"type":44,"tag":1967,"props":8220,"children":8221},{},[],{"type":44,"tag":943,"props":8223,"children":8225},{"id":8224},"navigate-the-stack",[8226],{"type":49,"value":8227},"Navigate the stack",{"type":44,"tag":51,"props":8229,"children":8230},{},[8231],{"type":49,"value":8232},"Move between branches without remembering branch names. These commands are fully non-interactive.",{"type":44,"tag":83,"props":8234,"children":8236},{"className":218,"code":8235,"language":220,"meta":91,"style":91},"gh stack up          # Move up one branch (further from trunk)\ngh stack up 3        # Move up three branches\ngh stack down        # Move down one branch (closer to trunk)\ngh stack down 2      # Move down two branches\ngh stack top         # Jump to the top of the stack (furthest from trunk)\ngh stack bottom      # Jump to the bottom (first non-merged branch above trunk)\ngh stack trunk       # Jump to the trunk branch (e.g. main)\n",[8237],{"type":44,"tag":55,"props":8238,"children":8239},{"__ignoreMap":91},[8240,8261,8286,8307,8332,8353,8374],{"type":44,"tag":226,"props":8241,"children":8242},{"class":228,"line":229},[8243,8247,8251,8256],{"type":44,"tag":226,"props":8244,"children":8245},{"style":233},[8246],{"type":49,"value":213},{"type":44,"tag":226,"props":8248,"children":8249},{"style":238},[8250],{"type":49,"value":1238},{"type":44,"tag":226,"props":8252,"children":8253},{"style":238},[8254],{"type":49,"value":8255}," up",{"type":44,"tag":226,"props":8257,"children":8258},{"style":296},[8259],{"type":49,"value":8260},"          # Move up one branch (further from trunk)\n",{"type":44,"tag":226,"props":8262,"children":8263},{"class":228,"line":302},[8264,8268,8272,8276,8281],{"type":44,"tag":226,"props":8265,"children":8266},{"style":233},[8267],{"type":49,"value":213},{"type":44,"tag":226,"props":8269,"children":8270},{"style":238},[8271],{"type":49,"value":1238},{"type":44,"tag":226,"props":8273,"children":8274},{"style":238},[8275],{"type":49,"value":8255},{"type":44,"tag":226,"props":8277,"children":8278},{"style":3999},[8279],{"type":49,"value":8280}," 3",{"type":44,"tag":226,"props":8282,"children":8283},{"style":296},[8284],{"type":49,"value":8285},"        # Move up three branches\n",{"type":44,"tag":226,"props":8287,"children":8288},{"class":228,"line":1099},[8289,8293,8297,8302],{"type":44,"tag":226,"props":8290,"children":8291},{"style":233},[8292],{"type":49,"value":213},{"type":44,"tag":226,"props":8294,"children":8295},{"style":238},[8296],{"type":49,"value":1238},{"type":44,"tag":226,"props":8298,"children":8299},{"style":238},[8300],{"type":49,"value":8301}," down",{"type":44,"tag":226,"props":8303,"children":8304},{"style":296},[8305],{"type":49,"value":8306},"        # Move down one branch (closer to trunk)\n",{"type":44,"tag":226,"props":8308,"children":8309},{"class":228,"line":1122},[8310,8314,8318,8322,8327],{"type":44,"tag":226,"props":8311,"children":8312},{"style":233},[8313],{"type":49,"value":213},{"type":44,"tag":226,"props":8315,"children":8316},{"style":238},[8317],{"type":49,"value":1238},{"type":44,"tag":226,"props":8319,"children":8320},{"style":238},[8321],{"type":49,"value":8301},{"type":44,"tag":226,"props":8323,"children":8324},{"style":3999},[8325],{"type":49,"value":8326}," 2",{"type":44,"tag":226,"props":8328,"children":8329},{"style":296},[8330],{"type":49,"value":8331},"      # Move down two branches\n",{"type":44,"tag":226,"props":8333,"children":8334},{"class":228,"line":1155},[8335,8339,8343,8348],{"type":44,"tag":226,"props":8336,"children":8337},{"style":233},[8338],{"type":49,"value":213},{"type":44,"tag":226,"props":8340,"children":8341},{"style":238},[8342],{"type":49,"value":1238},{"type":44,"tag":226,"props":8344,"children":8345},{"style":238},[8346],{"type":49,"value":8347}," top",{"type":44,"tag":226,"props":8349,"children":8350},{"style":296},[8351],{"type":49,"value":8352},"         # Jump to the top of the stack (furthest from trunk)\n",{"type":44,"tag":226,"props":8354,"children":8355},{"class":228,"line":1165},[8356,8360,8364,8369],{"type":44,"tag":226,"props":8357,"children":8358},{"style":233},[8359],{"type":49,"value":213},{"type":44,"tag":226,"props":8361,"children":8362},{"style":238},[8363],{"type":49,"value":1238},{"type":44,"tag":226,"props":8365,"children":8366},{"style":238},[8367],{"type":49,"value":8368}," bottom",{"type":44,"tag":226,"props":8370,"children":8371},{"style":296},[8372],{"type":49,"value":8373},"      # Jump to the bottom (first non-merged branch above trunk)\n",{"type":44,"tag":226,"props":8375,"children":8376},{"class":228,"line":1182},[8377,8381,8385,8390],{"type":44,"tag":226,"props":8378,"children":8379},{"style":233},[8380],{"type":49,"value":213},{"type":44,"tag":226,"props":8382,"children":8383},{"style":238},[8384],{"type":49,"value":1238},{"type":44,"tag":226,"props":8386,"children":8387},{"style":238},[8388],{"type":49,"value":8389}," trunk",{"type":44,"tag":226,"props":8391,"children":8392},{"style":296},[8393],{"type":49,"value":8394},"       # Jump to the trunk branch (e.g. main)\n",{"type":44,"tag":51,"props":8396,"children":8397},{},[8398],{"type":49,"value":8399},"Navigation clamps to stack bounds. Merged branches are skipped when navigating from active branches.",{"type":44,"tag":1967,"props":8401,"children":8402},{},[],{"type":44,"tag":943,"props":8404,"children":8406},{"id":8405},"check-out-a-stack-gh-stack-checkout",[8407,8409],{"type":49,"value":8408},"Check out a stack — ",{"type":44,"tag":55,"props":8410,"children":8412},{"className":8411},[],[8413],{"type":49,"value":665},{"type":44,"tag":51,"props":8415,"children":8416},{},[8417,8419,8424,8426,8431],{"type":49,"value":8418},"Check out a stack by stack number, pull request number, PR URL, or branch name. ",{"type":44,"tag":75,"props":8420,"children":8421},{},[8422],{"type":49,"value":8423},"Always provide an argument",{"type":49,"value":8425}," — running ",{"type":44,"tag":55,"props":8427,"children":8429},{"className":8428},[],[8430],{"type":49,"value":665},{"type":49,"value":8432}," without arguments triggers an interactive selection menu.",{"type":44,"tag":83,"props":8434,"children":8437},{"className":8435,"code":8436,"language":49},[86],"gh stack checkout \u003Cstack-number | pr-number | pr-url | branch>\n",[8438],{"type":44,"tag":55,"props":8439,"children":8440},{"__ignoreMap":91},[8441],{"type":49,"value":8436},{"type":44,"tag":83,"props":8443,"children":8445},{"className":218,"code":8444,"language":220,"meta":91,"style":91},"# By stack number (the identifier shown in the GitHub stack UI)\ngh stack checkout 7\n\n# By PR number (pulls from GitHub)\ngh stack checkout 42\n\n# By PR URL\ngh stack checkout https:\u002F\u002Fgithub.com\u002Fowner\u002Frepo\u002Fpull\u002F42\n\n# By branch name (local only)\ngh stack checkout feature-auth\n",[8446],{"type":44,"tag":55,"props":8447,"children":8448},{"__ignoreMap":91},[8449,8457,8478,8485,8493,8513,8520,8528,8548,8555,8563],{"type":44,"tag":226,"props":8450,"children":8451},{"class":228,"line":229},[8452],{"type":44,"tag":226,"props":8453,"children":8454},{"style":296},[8455],{"type":49,"value":8456},"# By stack number (the identifier shown in the GitHub stack UI)\n",{"type":44,"tag":226,"props":8458,"children":8459},{"class":228,"line":302},[8460,8464,8468,8473],{"type":44,"tag":226,"props":8461,"children":8462},{"style":233},[8463],{"type":49,"value":213},{"type":44,"tag":226,"props":8465,"children":8466},{"style":238},[8467],{"type":49,"value":1238},{"type":44,"tag":226,"props":8469,"children":8470},{"style":238},[8471],{"type":49,"value":8472}," checkout",{"type":44,"tag":226,"props":8474,"children":8475},{"style":3999},[8476],{"type":49,"value":8477}," 7\n",{"type":44,"tag":226,"props":8479,"children":8480},{"class":228,"line":1099},[8481],{"type":44,"tag":226,"props":8482,"children":8483},{"emptyLinePlaceholder":1159},[8484],{"type":49,"value":1162},{"type":44,"tag":226,"props":8486,"children":8487},{"class":228,"line":1122},[8488],{"type":44,"tag":226,"props":8489,"children":8490},{"style":296},[8491],{"type":49,"value":8492},"# By PR number (pulls from GitHub)\n",{"type":44,"tag":226,"props":8494,"children":8495},{"class":228,"line":1155},[8496,8500,8504,8508],{"type":44,"tag":226,"props":8497,"children":8498},{"style":233},[8499],{"type":49,"value":213},{"type":44,"tag":226,"props":8501,"children":8502},{"style":238},[8503],{"type":49,"value":1238},{"type":44,"tag":226,"props":8505,"children":8506},{"style":238},[8507],{"type":49,"value":8472},{"type":44,"tag":226,"props":8509,"children":8510},{"style":3999},[8511],{"type":49,"value":8512}," 42\n",{"type":44,"tag":226,"props":8514,"children":8515},{"class":228,"line":1165},[8516],{"type":44,"tag":226,"props":8517,"children":8518},{"emptyLinePlaceholder":1159},[8519],{"type":49,"value":1162},{"type":44,"tag":226,"props":8521,"children":8522},{"class":228,"line":1182},[8523],{"type":44,"tag":226,"props":8524,"children":8525},{"style":296},[8526],{"type":49,"value":8527},"# By PR URL\n",{"type":44,"tag":226,"props":8529,"children":8530},{"class":228,"line":1211},[8531,8535,8539,8543],{"type":44,"tag":226,"props":8532,"children":8533},{"style":233},[8534],{"type":49,"value":213},{"type":44,"tag":226,"props":8536,"children":8537},{"style":238},[8538],{"type":49,"value":1238},{"type":44,"tag":226,"props":8540,"children":8541},{"style":238},[8542],{"type":49,"value":8472},{"type":44,"tag":226,"props":8544,"children":8545},{"style":238},[8546],{"type":49,"value":8547}," https:\u002F\u002Fgithub.com\u002Fowner\u002Frepo\u002Fpull\u002F42\n",{"type":44,"tag":226,"props":8549,"children":8550},{"class":228,"line":1219},[8551],{"type":44,"tag":226,"props":8552,"children":8553},{"emptyLinePlaceholder":1159},[8554],{"type":49,"value":1162},{"type":44,"tag":226,"props":8556,"children":8557},{"class":228,"line":1228},[8558],{"type":44,"tag":226,"props":8559,"children":8560},{"style":296},[8561],{"type":49,"value":8562},"# By branch name (local only)\n",{"type":44,"tag":226,"props":8564,"children":8565},{"class":228,"line":1255},[8566,8570,8574,8578],{"type":44,"tag":226,"props":8567,"children":8568},{"style":233},[8569],{"type":49,"value":213},{"type":44,"tag":226,"props":8571,"children":8572},{"style":238},[8573],{"type":49,"value":1238},{"type":44,"tag":226,"props":8575,"children":8576},{"style":238},[8577],{"type":49,"value":8472},{"type":44,"tag":226,"props":8579,"children":8580},{"style":238},[8581],{"type":49,"value":6089},{"type":44,"tag":51,"props":8583,"children":8584},{},[8585,8587,8592],{"type":49,"value":8586},"A bare number is resolved as a ",{"type":44,"tag":75,"props":8588,"children":8589},{},[8590],{"type":49,"value":8591},"stack number first",{"type":49,"value":8593}," (the identifier shown in the GitHub stack UI); if no stack has that number it is tried as a PR number, then a branch name. When a stack or PR number (or PR URL) is provided, the command fetches the stack on GitHub, pulls the branches, and sets up the stack locally. If the stack already exists locally and matches, it switches to the branch.",{"type":44,"tag":2802,"props":8595,"children":8596},{},[8597],{"type":44,"tag":51,"props":8598,"children":8599},{},[8600,8605,8607,8612,8614,8619],{"type":44,"tag":75,"props":8601,"children":8602},{},[8603],{"type":49,"value":8604},"⚠️ Agent warning:",{"type":49,"value":8606}," If the local and remote stacks have different branch compositions, this command triggers an interactive conflict-resolution prompt that cannot be bypassed with a flag. To avoid this: run ",{"type":44,"tag":55,"props":8608,"children":8610},{"className":8609},[],[8611],{"type":49,"value":921},{"type":49,"value":8613}," first to remove the conflicting local tracking state (this keeps the stack on GitHub intact), then retry ",{"type":44,"tag":55,"props":8615,"children":8617},{"className":8616},[],[8618],{"type":49,"value":913},{"type":49,"value":402},{"type":44,"tag":51,"props":8621,"children":8622},{},[8623],{"type":49,"value":8624},"When a branch name is provided, the command resolves it against locally tracked stacks only. This is always safe for non-interactive use.",{"type":44,"tag":1967,"props":8626,"children":8627},{},[],{"type":44,"tag":943,"props":8629,"children":8631},{"id":8630},"remove-a-stack-gh-stack-unstack",[8632,8634],{"type":49,"value":8633},"Remove a stack — ",{"type":44,"tag":55,"props":8635,"children":8637},{"className":8636},[],[8638],{"type":49,"value":1883},{"type":44,"tag":51,"props":8640,"children":8641},{},[8642,8644,8649],{"type":49,"value":8643},"Tear down a stack so you can restructure it — remove a branch, reorder branches, rename branches, or make other large changes. After unstacking, use ",{"type":44,"tag":55,"props":8645,"children":8647},{"className":8646},[],[8648],{"type":49,"value":607},{"type":49,"value":8650}," to re-create the stack with the desired structure.",{"type":44,"tag":51,"props":8652,"children":8653},{},[8654],{"type":49,"value":8655},"Unstacking only removes the stack grouping (on GitHub and\u002For locally); it never deletes the underlying pull requests or branches.",{"type":44,"tag":51,"props":8657,"children":8658},{},[8659],{"type":49,"value":8660},"With no argument, the command targets the active stack — the one containing the currently checked out branch — unstacking it on GitHub and removing local tracking.",{"type":44,"tag":51,"props":8662,"children":8663},{},[8664,8666,8671],{"type":49,"value":8665},"Provide a stack number to unstack a specific stack on GitHub. This works from anywhere in the repository, whether or not the stack is checked out locally — the number is unstacked directly through the GitHub API (like ",{"type":44,"tag":55,"props":8667,"children":8669},{"className":8668},[],[8670],{"type":49,"value":697},{"type":49,"value":8672},", no local tracking required). If the stack is also tracked locally, its local tracking is removed as well.",{"type":44,"tag":83,"props":8674,"children":8677},{"className":8675,"code":8676,"language":49},[86],"gh stack unstack [\u003Cstack-number>] [flags]\n",[8678],{"type":44,"tag":55,"props":8679,"children":8680},{"__ignoreMap":91},[8681],{"type":49,"value":8676},{"type":44,"tag":83,"props":8683,"children":8685},{"className":218,"code":8684,"language":220,"meta":91,"style":91},"# Tear down the current stack — removes local tracking and the GitHub grouping (PRs are NOT deleted), then rebuild\ngh stack unstack\ngh stack init --base main branch-2 branch-1 branch-3 # reordered\n\n# Unstack a specific stack by its number, from anywhere in the repo\ngh stack unstack 7\n\n# Only remove local tracking (keep the stack on GitHub)\ngh stack unstack --local\n",[8686],{"type":44,"tag":55,"props":8687,"children":8688},{"__ignoreMap":91},[8689,8697,8712,8755,8762,8770,8790,8797,8805],{"type":44,"tag":226,"props":8690,"children":8691},{"class":228,"line":229},[8692],{"type":44,"tag":226,"props":8693,"children":8694},{"style":296},[8695],{"type":49,"value":8696},"# Tear down the current stack — removes local tracking and the GitHub grouping (PRs are NOT deleted), then rebuild\n",{"type":44,"tag":226,"props":8698,"children":8699},{"class":228,"line":302},[8700,8704,8708],{"type":44,"tag":226,"props":8701,"children":8702},{"style":233},[8703],{"type":49,"value":213},{"type":44,"tag":226,"props":8705,"children":8706},{"style":238},[8707],{"type":49,"value":1238},{"type":44,"tag":226,"props":8709,"children":8710},{"style":238},[8711],{"type":49,"value":4340},{"type":44,"tag":226,"props":8713,"children":8714},{"class":228,"line":1099},[8715,8719,8723,8727,8731,8735,8740,8745,8750],{"type":44,"tag":226,"props":8716,"children":8717},{"style":233},[8718],{"type":49,"value":213},{"type":44,"tag":226,"props":8720,"children":8721},{"style":238},[8722],{"type":49,"value":1238},{"type":44,"tag":226,"props":8724,"children":8725},{"style":238},[8726],{"type":49,"value":2012},{"type":44,"tag":226,"props":8728,"children":8729},{"style":238},[8730],{"type":49,"value":4416},{"type":44,"tag":226,"props":8732,"children":8733},{"style":238},[8734],{"type":49,"value":4421},{"type":44,"tag":226,"props":8736,"children":8737},{"style":238},[8738],{"type":49,"value":8739}," branch-2",{"type":44,"tag":226,"props":8741,"children":8742},{"style":238},[8743],{"type":49,"value":8744}," branch-1",{"type":44,"tag":226,"props":8746,"children":8747},{"style":238},[8748],{"type":49,"value":8749}," branch-3",{"type":44,"tag":226,"props":8751,"children":8752},{"style":296},[8753],{"type":49,"value":8754}," # reordered\n",{"type":44,"tag":226,"props":8756,"children":8757},{"class":228,"line":1122},[8758],{"type":44,"tag":226,"props":8759,"children":8760},{"emptyLinePlaceholder":1159},[8761],{"type":49,"value":1162},{"type":44,"tag":226,"props":8763,"children":8764},{"class":228,"line":1155},[8765],{"type":44,"tag":226,"props":8766,"children":8767},{"style":296},[8768],{"type":49,"value":8769},"# Unstack a specific stack by its number, from anywhere in the repo\n",{"type":44,"tag":226,"props":8771,"children":8772},{"class":228,"line":1165},[8773,8777,8781,8786],{"type":44,"tag":226,"props":8774,"children":8775},{"style":233},[8776],{"type":49,"value":213},{"type":44,"tag":226,"props":8778,"children":8779},{"style":238},[8780],{"type":49,"value":1238},{"type":44,"tag":226,"props":8782,"children":8783},{"style":238},[8784],{"type":49,"value":8785}," unstack",{"type":44,"tag":226,"props":8787,"children":8788},{"style":3999},[8789],{"type":49,"value":8477},{"type":44,"tag":226,"props":8791,"children":8792},{"class":228,"line":1182},[8793],{"type":44,"tag":226,"props":8794,"children":8795},{"emptyLinePlaceholder":1159},[8796],{"type":49,"value":1162},{"type":44,"tag":226,"props":8798,"children":8799},{"class":228,"line":1211},[8800],{"type":44,"tag":226,"props":8801,"children":8802},{"style":296},[8803],{"type":49,"value":8804},"# Only remove local tracking (keep the stack on GitHub)\n",{"type":44,"tag":226,"props":8806,"children":8807},{"class":228,"line":1219},[8808,8812,8816,8820],{"type":44,"tag":226,"props":8809,"children":8810},{"style":233},[8811],{"type":49,"value":213},{"type":44,"tag":226,"props":8813,"children":8814},{"style":238},[8815],{"type":49,"value":1238},{"type":44,"tag":226,"props":8817,"children":8818},{"style":238},[8819],{"type":49,"value":8785},{"type":44,"tag":226,"props":8821,"children":8822},{"style":238},[8823],{"type":49,"value":8824}," --local\n",{"type":44,"tag":1421,"props":8826,"children":8827},{},[8828,8842],{"type":44,"tag":1425,"props":8829,"children":8830},{},[8831],{"type":44,"tag":1429,"props":8832,"children":8833},{},[8834,8838],{"type":44,"tag":1433,"props":8835,"children":8836},{},[8837],{"type":49,"value":4667},{"type":44,"tag":1433,"props":8839,"children":8840},{},[8841],{"type":49,"value":4672},{"type":44,"tag":1444,"props":8843,"children":8844},{},[8845],{"type":44,"tag":1429,"props":8846,"children":8847},{},[8848,8857],{"type":44,"tag":1451,"props":8849,"children":8850},{},[8851],{"type":44,"tag":55,"props":8852,"children":8854},{"className":8853},[],[8855],{"type":49,"value":8856},"--local",{"type":44,"tag":1451,"props":8858,"children":8859},{},[8860],{"type":49,"value":8861},"Only remove the stack locally (keep it on GitHub); never contacts GitHub",{"type":44,"tag":2802,"props":8863,"children":8864},{},[8865],{"type":44,"tag":51,"props":8866,"children":8867},{},[8868,8872,8873,8879,8881,8886,8888,8893],{"type":44,"tag":75,"props":8869,"children":8870},{},[8871],{"type":49,"value":3430},{"type":49,"value":740},{"type":44,"tag":55,"props":8874,"children":8876},{"className":8875},[],[8877],{"type":49,"value":8878},"gh stack unstack \u003Cnumber>",{"type":49,"value":8880}," is a remote-first API wrapper — it unstacks on GitHub by number from anywhere in the repo, tracked locally or not, and is safe for non-interactive use. ",{"type":44,"tag":55,"props":8882,"children":8884},{"className":8883},[],[8885],{"type":49,"value":8856},{"type":49,"value":8887}," never contacts GitHub; combining ",{"type":44,"tag":55,"props":8889,"children":8891},{"className":8890},[],[8892],{"type":49,"value":8856},{"type":49,"value":8894}," with a number that isn't tracked locally is an error. An unknown stack number returns a \"not found on GitHub\" error (exit code 2).",{"type":44,"tag":1967,"props":8896,"children":8897},{},[],{"type":44,"tag":156,"props":8899,"children":8901},{"id":8900},"output-conventions",[8902],{"type":49,"value":8903},"Output conventions",{"type":44,"tag":168,"props":8905,"children":8906},{},[8907,8956,8980],{"type":44,"tag":172,"props":8908,"children":8909},{},[8910,8915,8917,8922,8924,8930,8932,8938,8940,8946,8948,8954],{"type":44,"tag":75,"props":8911,"children":8912},{},[8913],{"type":49,"value":8914},"Status messages",{"type":49,"value":8916}," go to ",{"type":44,"tag":75,"props":8918,"children":8919},{},[8920],{"type":49,"value":8921},"stderr",{"type":49,"value":8923}," with emoji prefixes: ",{"type":44,"tag":55,"props":8925,"children":8927},{"className":8926},[],[8928],{"type":49,"value":8929},"✓",{"type":49,"value":8931}," (success), ",{"type":44,"tag":55,"props":8933,"children":8935},{"className":8934},[],[8936],{"type":49,"value":8937},"✗",{"type":49,"value":8939}," (error), ",{"type":44,"tag":55,"props":8941,"children":8943},{"className":8942},[],[8944],{"type":49,"value":8945},"⚠",{"type":49,"value":8947}," (warning), ",{"type":44,"tag":55,"props":8949,"children":8951},{"className":8950},[],[8952],{"type":49,"value":8953},"ℹ",{"type":49,"value":8955}," (info).",{"type":44,"tag":172,"props":8957,"children":8958},{},[8959,8964,8966,8972,8974,8979],{"type":44,"tag":75,"props":8960,"children":8961},{},[8962],{"type":49,"value":8963},"Data output",{"type":49,"value":8965}," (e.g., ",{"type":44,"tag":55,"props":8967,"children":8969},{"className":8968},[],[8970],{"type":49,"value":8971},"view --json",{"type":49,"value":8973},") goes to ",{"type":44,"tag":75,"props":8975,"children":8976},{},[8977],{"type":49,"value":8978},"stdout",{"type":49,"value":402},{"type":44,"tag":172,"props":8981,"children":8982},{},[8983,8985,8991],{"type":49,"value":8984},"When piping output, use ",{"type":44,"tag":55,"props":8986,"children":8988},{"className":8987},[],[8989],{"type":49,"value":8990},"2>\u002Fdev\u002Fnull",{"type":49,"value":8992}," to suppress status messages if only data output is needed.",{"type":44,"tag":156,"props":8994,"children":8996},{"id":8995},"exit-codes-and-error-recovery",[8997],{"type":49,"value":8998},"Exit codes and error recovery",{"type":44,"tag":1421,"props":9000,"children":9001},{},[9002,9023],{"type":44,"tag":1425,"props":9003,"children":9004},{},[9005],{"type":44,"tag":1429,"props":9006,"children":9007},{},[9008,9013,9018],{"type":44,"tag":1433,"props":9009,"children":9010},{},[9011],{"type":49,"value":9012},"Code",{"type":44,"tag":1433,"props":9014,"children":9015},{},[9016],{"type":49,"value":9017},"Meaning",{"type":44,"tag":1433,"props":9019,"children":9020},{},[9021],{"type":49,"value":9022},"Agent action",{"type":44,"tag":1444,"props":9024,"children":9025},{},[9026,9044,9062,9087,9110,9136,9154,9180,9211,9236,9254],{"type":44,"tag":1429,"props":9027,"children":9028},{},[9029,9034,9039],{"type":44,"tag":1451,"props":9030,"children":9031},{},[9032],{"type":49,"value":9033},"0",{"type":44,"tag":1451,"props":9035,"children":9036},{},[9037],{"type":49,"value":9038},"Success",{"type":44,"tag":1451,"props":9040,"children":9041},{},[9042],{"type":49,"value":9043},"Proceed normally",{"type":44,"tag":1429,"props":9045,"children":9046},{},[9047,9052,9057],{"type":44,"tag":1451,"props":9048,"children":9049},{},[9050],{"type":49,"value":9051},"1",{"type":44,"tag":1451,"props":9053,"children":9054},{},[9055],{"type":49,"value":9056},"Generic error",{"type":44,"tag":1451,"props":9058,"children":9059},{},[9060],{"type":49,"value":9061},"Read stderr for details; may indicate commit\u002Fpush failure",{"type":44,"tag":1429,"props":9063,"children":9064},{},[9065,9070,9075],{"type":44,"tag":1451,"props":9066,"children":9067},{},[9068],{"type":49,"value":9069},"2",{"type":44,"tag":1451,"props":9071,"children":9072},{},[9073],{"type":49,"value":9074},"Not in a stack",{"type":44,"tag":1451,"props":9076,"children":9077},{},[9078,9080,9085],{"type":49,"value":9079},"Run ",{"type":44,"tag":55,"props":9081,"children":9083},{"className":9082},[],[9084],{"type":49,"value":607},{"type":49,"value":9086}," to create a stack first",{"type":44,"tag":1429,"props":9088,"children":9089},{},[9090,9095,9100],{"type":44,"tag":1451,"props":9091,"children":9092},{},[9093],{"type":49,"value":9094},"3",{"type":44,"tag":1451,"props":9096,"children":9097},{},[9098],{"type":49,"value":9099},"Rebase conflict",{"type":44,"tag":1451,"props":9101,"children":9102},{},[9103,9105],{"type":49,"value":9104},"Parse stderr for conflicted file paths, resolve conflicts, run ",{"type":44,"tag":55,"props":9106,"children":9108},{"className":9107},[],[9109],{"type":49,"value":1734},{"type":44,"tag":1429,"props":9111,"children":9112},{},[9113,9118,9123],{"type":44,"tag":1451,"props":9114,"children":9115},{},[9116],{"type":49,"value":9117},"4",{"type":44,"tag":1451,"props":9119,"children":9120},{},[9121],{"type":49,"value":9122},"GitHub API failure",{"type":44,"tag":1451,"props":9124,"children":9125},{},[9126,9128,9134],{"type":49,"value":9127},"Check ",{"type":44,"tag":55,"props":9129,"children":9131},{"className":9130},[],[9132],{"type":49,"value":9133},"gh auth status",{"type":49,"value":9135},", retry the command",{"type":44,"tag":1429,"props":9137,"children":9138},{},[9139,9144,9149],{"type":44,"tag":1451,"props":9140,"children":9141},{},[9142],{"type":49,"value":9143},"5",{"type":44,"tag":1451,"props":9145,"children":9146},{},[9147],{"type":49,"value":9148},"Invalid arguments",{"type":44,"tag":1451,"props":9150,"children":9151},{},[9152],{"type":49,"value":9153},"Fix the command invocation (check flags and arguments)",{"type":44,"tag":1429,"props":9155,"children":9156},{},[9157,9162,9167],{"type":44,"tag":1451,"props":9158,"children":9159},{},[9160],{"type":49,"value":9161},"6",{"type":44,"tag":1451,"props":9163,"children":9164},{},[9165],{"type":49,"value":9166},"Disambiguation required",{"type":44,"tag":1451,"props":9168,"children":9169},{},[9170,9172,9178],{"type":49,"value":9171},"A branch belongs to multiple stacks. Run ",{"type":44,"tag":55,"props":9173,"children":9175},{"className":9174},[],[9176],{"type":49,"value":9177},"gh stack checkout \u003Cspecific-branch>",{"type":49,"value":9179}," to switch to a non-shared branch first",{"type":44,"tag":1429,"props":9181,"children":9182},{},[9183,9188,9193],{"type":44,"tag":1451,"props":9184,"children":9185},{},[9186],{"type":49,"value":9187},"7",{"type":44,"tag":1451,"props":9189,"children":9190},{},[9191],{"type":49,"value":9192},"Rebase already in progress",{"type":44,"tag":1451,"props":9194,"children":9195},{},[9196,9197,9202,9204,9209],{"type":49,"value":9079},{"type":44,"tag":55,"props":9198,"children":9200},{"className":9199},[],[9201],{"type":49,"value":1734},{"type":49,"value":9203}," (after resolving conflicts) or ",{"type":44,"tag":55,"props":9205,"children":9207},{"className":9206},[],[9208],{"type":49,"value":1751},{"type":49,"value":9210}," to start over",{"type":44,"tag":1429,"props":9212,"children":9213},{},[9214,9219,9224],{"type":44,"tag":1451,"props":9215,"children":9216},{},[9217],{"type":49,"value":9218},"8",{"type":44,"tag":1451,"props":9220,"children":9221},{},[9222],{"type":49,"value":9223},"Stack is locked",{"type":44,"tag":1451,"props":9225,"children":9226},{},[9227,9229,9234],{"type":49,"value":9228},"Another ",{"type":44,"tag":55,"props":9230,"children":9232},{"className":9231},[],[9233],{"type":49,"value":60},{"type":49,"value":9235}," process is writing the stack file. Wait and retry — the lock times out after 5 seconds",{"type":44,"tag":1429,"props":9237,"children":9238},{},[9239,9244,9249],{"type":44,"tag":1451,"props":9240,"children":9241},{},[9242],{"type":49,"value":9243},"9",{"type":44,"tag":1451,"props":9245,"children":9246},{},[9247],{"type":49,"value":9248},"Stacked PRs unavailable",{"type":44,"tag":1451,"props":9250,"children":9251},{},[9252],{"type":49,"value":9253},"The repository does not have stacked PRs enabled. Tell the user that stacks must be enabled on the repository first",{"type":44,"tag":1429,"props":9255,"children":9256},{},[9257,9262,9267],{"type":44,"tag":1451,"props":9258,"children":9259},{},[9260],{"type":49,"value":9261},"10",{"type":44,"tag":1451,"props":9263,"children":9264},{},[9265],{"type":49,"value":9266},"Modify recovery required",{"type":44,"tag":1451,"props":9268,"children":9269},{},[9270,9272,9278,9280,9285,9287,9293],{"type":49,"value":9271},"A ",{"type":44,"tag":55,"props":9273,"children":9275},{"className":9274},[],[9276],{"type":49,"value":9277},"gh stack modify",{"type":49,"value":9279}," session was interrupted. This skill does not use ",{"type":44,"tag":55,"props":9281,"children":9283},{"className":9282},[],[9284],{"type":49,"value":549},{"type":49,"value":9286},", so agents should not produce this; if the repo is left in this state, run ",{"type":44,"tag":55,"props":9288,"children":9290},{"className":9289},[],[9291],{"type":49,"value":9292},"gh stack modify --abort",{"type":49,"value":9294}," to restore the pre-modify state",{"type":44,"tag":156,"props":9296,"children":9298},{"id":9297},"known-limitations",[9299],{"type":49,"value":9300},"Known limitations",{"type":44,"tag":351,"props":9302,"children":9303},{},[9304,9314,9324,9418,9448],{"type":44,"tag":172,"props":9305,"children":9306},{},[9307,9312],{"type":44,"tag":75,"props":9308,"children":9309},{},[9310],{"type":49,"value":9311},"Stacks are strictly linear.",{"type":49,"value":9313}," Branching stacks (multiple children on a single parent) are not supported. Each branch has exactly one parent and at most one child. If you need parallel workstreams, use separate stacks.",{"type":44,"tag":172,"props":9315,"children":9316},{},[9317,9322],{"type":44,"tag":75,"props":9318,"children":9319},{},[9320],{"type":49,"value":9321},"Stack disambiguation cannot be bypassed.",{"type":49,"value":9323}," If the current branch is the trunk of multiple stacks, commands error with code 6. Check out a non-shared branch first.",{"type":44,"tag":172,"props":9325,"children":9326},{},[9327,9339,9341,9346,9348,9353,9355,9360,9361,9366,9367,9372,9373,9378,9379,9384,9386,9391,9392,9397,9398,9403,9405,9410,9412,9417],{"type":44,"tag":75,"props":9328,"children":9329},{},[9330,9332,9337],{"type":49,"value":9331},"Multiple remotes require ",{"type":44,"tag":55,"props":9333,"children":9335},{"className":9334},[],[9336],{"type":49,"value":569},{"type":49,"value":9338}," or config.",{"type":49,"value":9340}," If more than one remote is configured, set ",{"type":44,"tag":55,"props":9342,"children":9344},{"className":9343},[],[9345],{"type":49,"value":579},{"type":49,"value":9347}," in git config, or pass ",{"type":44,"tag":55,"props":9349,"children":9351},{"className":9350},[],[9352],{"type":49,"value":500},{"type":49,"value":9354}," to the commands that accept it (",{"type":44,"tag":55,"props":9356,"children":9358},{"className":9357},[],[9359],{"type":49,"value":508},{"type":49,"value":120},{"type":44,"tag":55,"props":9362,"children":9364},{"className":9363},[],[9365],{"type":49,"value":438},{"type":49,"value":120},{"type":44,"tag":55,"props":9368,"children":9370},{"className":9369},[],[9371],{"type":49,"value":521},{"type":49,"value":120},{"type":44,"tag":55,"props":9374,"children":9376},{"className":9375},[],[9377],{"type":49,"value":528},{"type":49,"value":120},{"type":44,"tag":55,"props":9380,"children":9382},{"className":9381},[],[9383],{"type":49,"value":535},{"type":49,"value":9385},"). ",{"type":44,"tag":55,"props":9387,"children":9389},{"className":9388},[],[9390],{"type":49,"value":384},{"type":49,"value":120},{"type":44,"tag":55,"props":9393,"children":9395},{"className":9394},[],[9396],{"type":49,"value":549},{"type":49,"value":378},{"type":44,"tag":55,"props":9399,"children":9401},{"className":9400},[],[9402],{"type":49,"value":556},{"type":49,"value":9404}," have no ",{"type":44,"tag":55,"props":9406,"children":9408},{"className":9407},[],[9409],{"type":49,"value":569},{"type":49,"value":9411}," flag and rely on ",{"type":44,"tag":55,"props":9413,"children":9415},{"className":9414},[],[9416],{"type":49,"value":579},{"type":49,"value":402},{"type":44,"tag":172,"props":9419,"children":9420},{},[9421,9426,9427,9432,9434,9439,9440,9446],{"type":44,"tag":75,"props":9422,"children":9423},{},[9424],{"type":49,"value":9425},"Remote stack checkout requires a stack or PR number.",{"type":49,"value":740},{"type":44,"tag":55,"props":9428,"children":9430},{"className":9429},[],[9431],{"type":49,"value":384},{"type":49,"value":9433}," with a branch name only works with locally tracked stacks. Use a stack number or PR number (e.g. ",{"type":44,"tag":55,"props":9435,"children":9437},{"className":9436},[],[9438],{"type":49,"value":1832},{"type":49,"value":832},{"type":44,"tag":55,"props":9441,"children":9443},{"className":9442},[],[9444],{"type":49,"value":9445},"gh stack checkout 123",{"type":49,"value":9447},") to pull a stack from GitHub.",{"type":44,"tag":172,"props":9449,"children":9450},{},[9451,9456,9458,9463,9465,9471],{"type":44,"tag":75,"props":9452,"children":9453},{},[9454],{"type":49,"value":9455},"PR title and body are auto-generated.",{"type":49,"value":9457}," There is no flag to set a custom PR title or body during ",{"type":44,"tag":55,"props":9459,"children":9461},{"className":9460},[],[9462],{"type":49,"value":438},{"type":49,"value":9464},". The title and body are generated from commit messages plus a footer. Use ",{"type":44,"tag":55,"props":9466,"children":9468},{"className":9467},[],[9469],{"type":49,"value":9470},"gh pr edit",{"type":49,"value":9472}," to modify PR title and body after creation.",{"type":44,"tag":9474,"props":9475,"children":9476},"style",{},[9477],{"type":49,"value":9478},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"items":9480,"total":2502},[9481,9505,9523,9539,9553,9569,9583,9595,9607,9619,9635,9647],{"slug":9482,"name":9482,"fn":9483,"description":9484,"org":9485,"tags":9486,"stars":9502,"repoUrl":9503,"updatedAt":9504},"qdrant-horizontal-scaling","guide Qdrant horizontal scaling decisions","Diagnoses and guides Qdrant horizontal scaling decisions. Use when someone asks 'vertical or horizontal?', 'how many nodes?', 'how many shards?', 'how to add nodes', 'resharding', 'data doesn't fit', or 'need more capacity'. Also use when data growth outpaces current deployment.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[9487,9490,9493,9496,9499],{"name":9488,"slug":9489,"type":13},"AI Infrastructure","ai-infrastructure",{"name":9491,"slug":9492,"type":13},"Architecture","architecture",{"name":9494,"slug":9495,"type":13},"Capacity Planning","capacity-planning",{"name":9497,"slug":9498,"type":13},"Database","database",{"name":9500,"slug":9501,"type":13},"Qdrant","qdrant",36978,"https:\u002F\u002Fgithub.com\u002Fgithub\u002Fawesome-copilot","2026-04-18T04:46:16.349561",{"slug":9506,"name":9506,"fn":9507,"description":9508,"org":9509,"tags":9510,"stars":9502,"repoUrl":9503,"updatedAt":9522},"qdrant-indexing-performance-optimization","optimize Qdrant indexing performance","Diagnoses and fixes slow Qdrant indexing and data ingestion. Use when someone reports 'uploads are slow', 'indexing takes forever', 'optimizer is stuck', 'HNSW build time too long', or 'data uploaded but search is bad'. Also use when optimizer status shows errors, segments won't merge, or indexing threshold questions arise.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[9511,9514,9515,9518,9521],{"name":9512,"slug":9513,"type":13},"Data Engineering","data-engineering",{"name":9497,"slug":9498,"type":13},{"name":9516,"slug":9517,"type":13},"ETL","etl",{"name":9519,"slug":9520,"type":13},"Performance","performance",{"name":9500,"slug":9501,"type":13},"2026-04-18T04:46:02.766357",{"slug":9524,"name":9524,"fn":9525,"description":9526,"org":9527,"tags":9528,"stars":9502,"repoUrl":9503,"updatedAt":9538},"qdrant-memory-usage-optimization","optimize Qdrant memory usage","Diagnoses and reduces Qdrant memory usage. Use when someone reports 'memory too high', 'RAM keeps growing', 'node crashed', 'out of memory', 'memory leak', or asks 'why is memory usage so high?', 'how to reduce RAM?'. Also use when memory doesn't match calculations, quantization didn't help, or nodes crash during recovery.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[9529,9532,9533,9536,9537],{"name":9530,"slug":9531,"type":13},"Cost Optimization","cost-optimization",{"name":9497,"slug":9498,"type":13},{"name":9534,"slug":9535,"type":13},"Observability","observability",{"name":9519,"slug":9520,"type":13},{"name":9500,"slug":9501,"type":13},"2026-04-18T04:46:01.525023",{"slug":9540,"name":9540,"fn":9541,"description":9542,"org":9543,"tags":9544,"stars":9502,"repoUrl":9503,"updatedAt":9552},"qdrant-minimize-latency","minimize Qdrant query latency","Guides Qdrant query latency optimization. Use when someone asks 'search is slow', 'how to reduce latency', 'p99 is too high', 'tail latency', 'single query too slow', 'how to make search faster', or 'latency spikes'.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[9545,9546,9547,9548,9549],{"name":9491,"slug":9492,"type":13},{"name":9497,"slug":9498,"type":13},{"name":9519,"slug":9520,"type":13},{"name":9500,"slug":9501,"type":13},{"name":9550,"slug":9551,"type":13},"Search","search","2026-04-18T04:46:10.126667",{"slug":9554,"name":9554,"fn":9555,"description":9556,"org":9557,"tags":9558,"stars":9502,"repoUrl":9503,"updatedAt":9568},"qdrant-monitoring-debugging","debug Qdrant production issues with metrics","Diagnoses Qdrant production issues using metrics and observability tools. Use when someone reports 'optimizer stuck', 'indexing too slow', 'memory too high', 'OOM crash', 'queries are slow', 'latency spike', or 'search was fast now it's slow'. Also use when performance degrades without obvious config changes.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[9559,9562,9565,9566,9567],{"name":9560,"slug":9561,"type":13},"Debugging","debugging",{"name":9563,"slug":9564,"type":13},"Monitoring","monitoring",{"name":9534,"slug":9535,"type":13},{"name":9519,"slug":9520,"type":13},{"name":9500,"slug":9501,"type":13},"2026-04-18T04:46:06.450784",{"slug":9570,"name":9570,"fn":9571,"description":9572,"org":9573,"tags":9574,"stars":9502,"repoUrl":9503,"updatedAt":9582},"qdrant-monitoring-setup","set up Qdrant monitoring and alerting","Guides Qdrant monitoring setup including Prometheus scraping, health probes, Hybrid Cloud metrics, alerting, and log centralization. Use when someone asks 'how to set up monitoring', 'Prometheus config', 'Grafana dashboard', 'health check endpoints', 'how to scrape Hybrid Cloud', 'what alerts to set', 'how to centralize logs', or 'audit logging'.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[9575,9576,9577,9578,9579],{"name":9488,"slug":9489,"type":13},{"name":9563,"slug":9564,"type":13},{"name":9534,"slug":9535,"type":13},{"name":9500,"slug":9501,"type":13},{"name":9580,"slug":9581,"type":13},"SRE","sre","2026-04-18T04:46:05.217192",{"slug":9584,"name":9584,"fn":9585,"description":9586,"org":9587,"tags":9588,"stars":9502,"repoUrl":9503,"updatedAt":9594},"qdrant-scaling-data-volume","scale Qdrant data volume","Guides Qdrant data volume scaling decisions. Use when someone asks 'data doesn't fit on one node', 'too much data', 'need more storage', 'vertical or horizontal scaling', 'tenant scaling', 'time window rotation', or 'data growth exceeds capacity'.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[9589,9590,9591,9592,9593],{"name":9488,"slug":9489,"type":13},{"name":9491,"slug":9492,"type":13},{"name":9494,"slug":9495,"type":13},{"name":9497,"slug":9498,"type":13},{"name":9500,"slug":9501,"type":13},"2026-04-18T04:46:07.684464",{"slug":9596,"name":9596,"fn":9597,"description":9598,"org":9599,"tags":9600,"stars":9502,"repoUrl":9503,"updatedAt":9606},"qdrant-scaling-qps","scale Qdrant query throughput","Guides Qdrant query throughput (QPS) scaling. Use when someone asks 'how to increase QPS', 'need more throughput', 'queries per second too low', 'batch search', 'read replicas', or 'how to handle more concurrent queries'.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[9601,9602,9603,9604,9605],{"name":9488,"slug":9489,"type":13},{"name":9491,"slug":9492,"type":13},{"name":9497,"slug":9498,"type":13},{"name":9519,"slug":9520,"type":13},{"name":9500,"slug":9501,"type":13},"2026-04-18T04:46:08.905219",{"slug":9608,"name":9608,"fn":9609,"description":9610,"org":9611,"tags":9612,"stars":9502,"repoUrl":9503,"updatedAt":9618},"qdrant-scaling-query-volume","scale Qdrant query volume and pagination","Guides Qdrant query volume scaling. Use when someone asks 'query returns too many results', 'scroll performance', 'large limit values', 'paginating search results', 'fetching many vectors', or 'high cardinality results'.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[9613,9614,9615,9616,9617],{"name":9491,"slug":9492,"type":13},{"name":9497,"slug":9498,"type":13},{"name":9519,"slug":9520,"type":13},{"name":9500,"slug":9501,"type":13},{"name":9550,"slug":9551,"type":13},"2026-04-18T04:46:11.371326",{"slug":9620,"name":9620,"fn":9621,"description":9622,"org":9623,"tags":9624,"stars":9502,"repoUrl":9503,"updatedAt":9634},"qdrant-search-quality-diagnosis","diagnose Qdrant search quality issues","Diagnoses Qdrant search quality issues. Use when someone reports 'results are bad', 'wrong results', 'not relevant results', 'missing matches', 'recall is low', 'approximate search worse than exact', 'which embedding model', or 'quality dropped after quantization'. Also use when search quality degrades without obvious changes.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[9625,9628,9631,9632,9633],{"name":9626,"slug":9627,"type":13},"Analytics","analytics",{"name":9629,"slug":9630,"type":13},"Data Quality","data-quality",{"name":9560,"slug":9561,"type":13},{"name":9500,"slug":9501,"type":13},{"name":9550,"slug":9551,"type":13},"2026-04-18T04:46:17.579894",{"slug":9636,"name":9636,"fn":9637,"description":9638,"org":9639,"tags":9640,"stars":9502,"repoUrl":9503,"updatedAt":9646},"qdrant-search-speed-optimization","optimize Qdrant search speed","Diagnoses and fixes slow Qdrant search. Use when someone reports 'search is slow', 'high latency', 'queries take too long', 'low QPS', 'throughput too low', 'filtered search is slow', or 'search was fast but now it's slow'. Also use when search performance degrades after config changes or data growth.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[9641,9642,9643,9644,9645],{"name":9626,"slug":9627,"type":13},{"name":9497,"slug":9498,"type":13},{"name":9519,"slug":9520,"type":13},{"name":9500,"slug":9501,"type":13},{"name":9550,"slug":9551,"type":13},"2026-04-18T04:46:03.987332",{"slug":9648,"name":9648,"fn":9649,"description":9650,"org":9651,"tags":9652,"stars":9502,"repoUrl":9503,"updatedAt":9658},"qdrant-search-strategies","select optimal Qdrant search strategies","Guides Qdrant search strategy selection. Use when someone asks 'should I use hybrid search?', 'BM25 or sparse vectors?', 'how to rerank?', 'results are not relevant', 'I don't get needed results from my dataset but they're there', 'retrieval quality is not good enough', 'results too similar', 'need diversity', 'MMR', 'relevance feedback', 'recommendation API', 'discovery API', 'ColBERT reranking', or 'missing keyword matches'",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[9653,9654,9655,9656,9657],{"name":9488,"slug":9489,"type":13},{"name":9626,"slug":9627,"type":13},{"name":9491,"slug":9492,"type":13},{"name":9500,"slug":9501,"type":13},{"name":9550,"slug":9551,"type":13},"2026-04-18T04:46:18.812306",{"items":9660,"total":229},[9661],{"slug":4,"name":4,"fn":5,"description":6,"org":9662,"tags":9663,"stars":23,"repoUrl":24,"updatedAt":25},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[9664,9665,9666,9667],{"name":15,"slug":16,"type":13},{"name":18,"slug":19,"type":13},{"name":9,"slug":8,"type":13},{"name":21,"slug":22,"type":13}]