title | intro | redirect_from | versions | topics | shortTitle | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Reviewing proposed changes in a pull request |
In a pull request, you can review and discuss commits, changed files, and the differences (or "diff") between the files in the base and compare branches. |
|
|
|
Review proposed changes |
You can review changes in a pull request one file at a time. While reviewing the files in a pull request, you can leave individual comments on specific changes. After you finish reviewing each file, you can mark the file as viewed. This collapses the file, helping you identify the files you still need to review. A progress bar in the pull request header shows the number of files you've viewed. After reviewing as many files as you want, you can approve the pull request or request additional changes by submitting your review with a summary comment.
{% data reusables.search.requested_reviews_search_tip %}
{% webui %}
{% data reusables.repositories.sidebar-pr %} {% data reusables.repositories.choose-pr-review %} {% data reusables.repositories.changed-files %} You can change the format of the diff view in this tab by clicking {% octicon "gear" aria-label="The Settings gear" %} and choosing the unified or split view. The choice you make will apply when you view the diff for other pull requests.
You can also choose to hide whitespace differences. The choice you make only applies to this pull request and will be remembered the next time you visit this page.
- Optionally, filter the files to show only the files you want to review{% ifversion pr-tree-view %} or use the file tree to navigate to a specific file{% endif %}. For more information, see "AUTOTITLE." {%- ifversion ghec %}
- Optionally, if you have access to {% data variables.product.prodname_copilot_enterprise %}, you can ask {% data variables.product.prodname_copilot_short %} about the changes in a file in a pull request by clicking {% octicon "kebab-horizontal" aria-label="Show options" %} at the top right of the file, clicking Ask {% data variables.product.prodname_copilot_short %} about this diff, then typing a request such as "Explain these changes." For more information, see "AUTOTITLE." {%- endif %} {% data reusables.repositories.start-line-comment %} {% data reusables.repositories.multiple-lines-comment %} {% data reusables.repositories.type-line-comment %} {% data reusables.repositories.suggest-changes %} {% ifversion pull-request-comment-on-file %} {% data reusables.repositories.start-file-comment %}{% endif %}
- When you're done, click Start a review. If you have already started a review, you can click Add review comment.
Before you submit your review, your line comments are pending and only visible to you. You can edit pending comments anytime before you submit your review. To cancel a pending review, including all of its pending comments, click Review changes above the changed code, then click Abandon review.
{% ifversion fpt or ghec %}
{% codespaces %}
You can use {% data variables.product.prodname_github_codespaces %} to test, run, and review pull requests.
-
Open the pull request in a codespace, as described in "AUTOTITLE."
-
In the Activity Bar, click the GitHub Pull Request view. This view only appears when you open a pull request in a codespace.
-
To review a specific file, click the Open File icon in the Side Bar.
-
To add review comments, click the + icon next to the line number. Type your review comment and then click Start Review.
{% data reusables.codespaces.reviewing-a-pr %}
-
When you are finished adding review comments, from the Side Bar you can choose to either submit the comments, approve the changes, or request changes.
For more information on reviewing pull requests in {% data variables.product.prodname_github_codespaces %}, see "AUTOTITLE."
{% endcodespaces %} {% endif %}
If the pull request contains changes to dependencies you can use the dependency review for a manifest or lock file to see what has changed and check whether the changes introduce security vulnerabilities. For more information, see "AUTOTITLE."
{% data reusables.repositories.changed-files %}
-
On the right of the header for a manifest or lock file, display the dependency review by clicking the {% octicon "file" aria-label="The rich diff icon" %} rich diff button.
{% data reusables.repositories.return-to-source-diff %}
After you finish reviewing a file, you can mark the file as viewed, and the file will collapse. If the file changes after you view the file, it will be unmarked as viewed.
{% data reusables.repositories.changed-files %}
After you've finished reviewing all the files you want in the pull request, submit your review.
{% data reusables.repositories.changed-files %} {% data reusables.repositories.review-changes %} {% data reusables.repositories.review-summary-comment %}
-
Select the type of review you'd like to leave:
- Select Comment to leave general feedback without explicitly approving the changes or requesting additional changes.
- Select Approve to submit your feedback and approve merging the changes proposed in the pull request.
- Select Request changes to submit feedback that must be addressed before the pull request can be merged. {% data reusables.repositories.submit-review %}
{% data reusables.repositories.request-changes-tips %}