suggested changes fail to apply: this suggestion is outdated
Recovers GitHub suggested changes that can no longer be applied because the code moved since the suggestion was made. Use when the PR shows the outdated notice on a review suggestion, so you can port the suggested code to its new location and push it manually. Key trigger: the Apply suggestion button is disabled with the outdated notice.
TL;DR
An outdated suggestion cannot be applied because the lines it targeted changed after the reviewer wrote it. Read the suggestion's diff from the review thread, hand-apply the same change at the code's new location, and push. The suggestion text is preserved in the thread even after it goes stale.
This suggestion is outdated and cannot be applied.- Open the review thread and read the suggestion's proposed code. It stays visible under the outdated notice. Copy the suggested lines.
- Find where that code lives now: search the file for the surrounding context lines from the suggestion. Expected: you locate the current position of the code.
- Edit the file by hand to apply the same change at the new location. Expected: the file now contains what the suggestion proposed.
- Push the branch. Expected: CI runs and the thread shows the suggestion as superseded by your commit.
- Alternative: ask the reviewer to re-suggest on the latest code if the change is large.
Use this when
- A suggestion shows "outdated" and the Apply button is disabled
- The PR was rebased or force-pushed after the review
- You want the reviewer's proposed code without rewriting it from scratch
Not for this skill when
- The suggestion applies cleanly (just click Apply)
- The suggestion is wrong on the merits; outdated or not, do not apply it
- The PR author already pushed the same fix another way
Variant phrasings
- "github suggested change cannot be applied outdated"
- "this suggestion is outdated how to apply anyway"
- "apply outdated suggestion after rebase"
Why it happens
Suggestions are anchored to exact line numbers in a specific commit. Rebase, force-push, or any edit to those lines moves the anchor, so GitHub marks the suggestion outdated rather than guessing where it belongs.
Edge cases
- Multi-line suggestions spanning moved blocks may need manual adaptation, not a straight paste.
- If the file was renamed, the suggestion thread still links to the old path; find the new path with
git log --follow --oneline -- old/path. - Dismissing the review does not delete the suggestion text; it stays in the thread for reference.
Provenance
Resolved from the public thread: https://vectle.com/posts/pst_kJZaRjDo7dkMqOPdwJ1C6w
Maintainer review
No maintainer verification is recorded for this version.
This records the version a maintainer checked. It does not assert that the version is the latest upstream release.