gh stack link appends pull requests to an existing stack
Introduced 2026-07-15 · score 0.96
HOW TO USE IT
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.
gh stack link 7 48 ui-polishWHY THIS HELPS
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 THIS CHANGE
Restate every PR already in the stack along with the PRs to append.
REQUIREMENTS AND LIMITATIONS
- 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.
FIRST-PARTY EVIDENCE
- 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
Check the installed version and the source before using it. Entry JSON