You can comment on an unchanged line in a GitHub pull request only when the line sits in a file the pull request changes, and only on the new Files changed page: expand the hidden lines and click the + next to the line. A file the pull request doesn’t touch takes no comments at all. For that case, comment on the nearest changed file or on the Conversation tab and paste a permalink to the exact lines.
Why GitHub won’t take a comment outside the diff
A review comment lives on the diff. The REST docs for review comments describe the line parameter as the line of the blob in the pull request diff that the comment applies to. GitHub uses that position to show the comment next to the code and to mark it outdated when a later commit changes the line, and a file the pull request never touched has no position to give.
On the classic Files changed page, the same limit reaches unchanged lines inside changed files. You can expand the context around a hunk and read it, but line comments only work on the lines around a change. That hurts most on refactors, where the bug is often in a caller three screens up that the author forgot to update.
Unchanged lines in a changed file
GitHub’s September 2025 changelog added comments on unchanged lines to the new Files changed page, and the January 2026 changelog started rolling that page out as the default, describing it as letting you comment on any line of a changed file. The steps:
- Open the pull request’s Files changed tab.
- Expand all or part of the file until the line you want shows.
- Click the + on that line and write your comment.
The comment shows up on the Files changed and Conversation pages. The changelogs list a few limits:
- It only works in files the pull request already changes.
- GitHub still lets people opt out to the classic page, and there they see a warning instead of your comment.
- API support is limited, though existing APIs and webhooks do return these comments.
If the + doesn’t show up on an expanded line, you are probably on the classic page, or the feature hasn’t reached that repository yet, since GitHub rolled it out gradually.
Files the pull request doesn’t touch
These take no comments at all, so leave yours somewhere nearby and point at the code. In order of how close the comment stays to the code:
- Comment on the closest changed file. Per GitHub’s docs on commenting, the comment icon to the right of a file header leaves a comment on the whole file. Pick the changed file that calls into the code you mean, so the thread shows up where the author will look. Through the API, the same thing is
subject_type: file. - Paste a permalink. Open the file on the pull request’s head branch, click the line number, Shift-click the last line, then pick Copy permalink from the menu next to the selection. GitHub’s permalink docs say the link renders as a code snippet, with file name and line numbers, in the repository it came from. Pasted into another repository, it stays a plain URL.
- Ask for the file to join the pull request. If the fix really belongs in that file, say so in a comment. Once the author changes it, it’s in the diff and takes line comments and suggestions like any other file.
Suggested changes outside the diff
A suggested change only works where a line comment works, because it proposes replacement text for the lines its comment sits on, so in a file outside the pull request there is nothing to replace. Write the change out in a code block next to the permalink instead. The author has to apply it by hand, though it still tells them exactly what you want, and that matters more for a review comment that lands.
Expanding context on large pull requests
Expanding is per hunk, so on a big change I end up clicking the same file open over and over to trace one call path. When the code you need is mostly outside the diff, it’s often faster to check out the branch and read it in your editor, then come back and leave the comment on the nearest changed line or file. I wrote more about that in how to review large pull requests.
If you review in Pyor, a line comment that GitHub won’t take shows Can’t comment on that line, and Comment on file moves your text to a file comment, so you don’t lose what you wrote.
Frequently asked questions
Can I comment on an unchanged line in a GitHub pull request?
Yes, if the line is in a file the pull request changes and you use the new Files changed page. Expand the hidden lines, then click the + on the line. On the classic page, line comments stay close to the changed lines, and comments left on unchanged lines show up there only as a warning that points to the new page.
Can I comment on a file that is not part of the pull request?
No. GitHub’s changelog says you can’t comment on unchanged files, only on files the pull request already changes. Leave the comment on the closest related file or on the Conversation tab, and paste a permalink to the lines you mean.
Can I suggest a change to a line outside the diff?
A suggestion lives inside a line comment and proposes replacement text for the lines that comment sits on, so it only works where a line comment works. For a file the pull request does not touch, describe the change in a comment with a permalink, or ask the author to add the file to the pull request.