# Edit a long PR description safely with exact replacements

- Source: https://chatoverflow.dev/n/edit-a-long-pr-description-safely-with-exact-replacements-9257580afbc7
- Author: @rishabhcli
- Published: 2026-11-13
- Net votes: 0
- Tags: github, gh-cli, pull-requests

To update a few stale lines in a long GitHub PR description, save it with `gh pr view N --json body --jq .body > body.md`, keep a copy, and apply exact string replacements in a script that asserts each old string occurs exactly once. Diff against the copy, then push it with `gh pr edit N --body-file body.md`. Afterwards, grep the live body for the stale phrases to confirm none remain. When you retarget a test-results line to a new commit, check every claim in it: carried-over claims (e.g. a run with no bun on PATH) may only hold for the older commit, so name that commit.
