{
  "slug": "gh-stack-link-appends-pull-requests-to-an-existing-stack-ccd877353da0",
  "title": "gh stack link appends pull requests to an existing stack",
  "tools": [
    "gh-stack"
  ],
  "tags": [
    "agent"
  ],
  "introduced_at": "2026-07-15T17:28:54.000Z",
  "announced_at": "2026-07-15T17:28:54.000Z",
  "effective_at": null,
  "date_basis": "source-publication",
  "status": "unknown",
  "how": {
    "incantation": "When appending pull requests to an existing stack, run `gh stack link <stack-number> <pr-number-or-url> <branch-name>`; the stack number selects the target, and the remaining arguments are ordered bottom to top.",
    "examples": [
      "gh stack link 7 48 ui-polish"
    ],
    "gotchas": [
      "Version: v0.0.8",
      "<stack-number> (required): Target existing stack number; the task’s release example uses it as the first argument.",
      "<branch-or-pr> (required): One or more branch names, PR numbers, or PR URLs, in stack order from bottom to top. Branches are pushed automatically; mismatched PR base branches are corrected.",
      "Prerequisite: Install GitHub CLI 2.0+ and Git 2.36+; install the extension with `gh extension install github/gh-stack`. Authenticate with `gh auth login` if needed.",
      "The operation appends PRs to the top of an existing stack.",
      "PRs that belong to a different stack are rejected."
    ]
  },
  "why_it_matters": "When adding pull requests to the top of an existing stack, link them by stack number without restating the stack's existing pull requests.",
  "before": "Restate every PR already in the stack along with the PRs to append.",
  "sources": [
    "https://github.com/github/gh-stack/releases/tag/v0.0.8",
    "https://github.com/github/docs/blob/main/content/pull-requests/reference/stacked-prs-cli-commands.md"
  ],
  "rank": 0.96028,
  "judge": {
    "publish": true,
    "judge_model": "codex-cli/gpt-6-luna+typesafe/jev-1.13.0",
    "prompt_version": "extract-v7+enrich-v1+judge-v2x3+jev-publish-v1"
  },
  "review_state": "approved",
  "provenance": {
    "run_id": "recover-20261008",
    "verdict_id": "recover-20261008:recover-20261008-00890c982ae52383-2:gate",
    "evidence_hash": "8c610ca63f990c218a1377571bfb0983cda993b4d2b1250db23b2885d99ca55f"
  },
  "review": {
    "draft_hash": "55ce712b64538f4df300b284399b63ac314e5f712914d4ea07dac987bcfd43f1",
    "reviewer": "publication-gate",
    "reviewed_at": "2026-10-07T00:00:00.000Z",
    "decision": "recover-20261008:gate",
    "reason": "3 of 3 judge runs approved with p_yes >= 0.9 (mean 0.96 >= 0.9; 2 needed) and Jev gave 0.73 (>= 0.6 needed)."
  }
}
