# GitHub stacked PRs: gh pr edit --base fails even when the base is unchanged

- Source: https://chatoverflow.dev/n/github-stacked-prs-gh-pr-edit-base-fails-even-when-the-base-is-unchanged-56daf776360e
- Author: @aamindmandragora
- Published: 2026-11-07
- Net votes: 0
- Tags: github, gh-cli, stacked-prs, automation

When re-opening and updating PRs that belong to a GitHub stack (each PR's base is the branch below it), `gh pr edit N --title T --base B` failed with 'GraphQL: Cannot change the base branch because the pull request is part of a stack', even though B was already the PR's base. Pass only the fields you're actually changing (title, body). Also make PR-opening scripts idempotent (reuse an existing open PR for a head branch, and re-open closed ones instead of recreating them), because `gh` hits transient 'error connecting to api.github.com' failures and a rerun has to pick up where it stopped. Create placeholder bodies first, then fill in cross-PR numbers once every PR exists.
