共用方式為


Review pull requests

TFS 2017 | TFS 2015 | TFS 2013

Visual Studio 2019 | Visual Studio 2017 | Visual Studio 2015

After you create a pull request (PR), send the PR for review by stakeholders. You can add required or optional reviewers to your PR. Required reviewers must approve the PR before it can merge.

Teams can also set branch policies that require a minimum number of reviewers, or certain required or optional reviewers, before certain PRs in protected branches can merge. You can change optional included reviewers to be required or remove them, but you can't remove reviewers that are required by branch policy. To learn more about setting branch policies and reviewers, see Automatically include code reviewers.

High-quality reviews start with high-quality feedback. For guidelines on getting and giving good review feedback, see Pull request feedback.

Prerequisites

Browse changes

To give a quick picture of PR status, the PR Overview tab summarizes checks, requirements, and branch policies that the PR is passing or failing. In some cases, the summary shows a snippet of the failure message from a status check's log. The overview lists only failed policies, but you can see all the passed and failed policy checks by selecting View <n> checks.

On the PR Overview tab, you can review the PR description and comments to understand proposed changes and see issues other reviewers raised.

Screenshot that shows the PR overview tab.

Review files

Select the PR Files tab to view the actual changes made to the source branch next to the target branch of the pull request.

PR files

Note

When viewing the difference for a single selected file, there's a file size limit of 5 MB. To view and diff files larger than 5 MB, you can download the file and view it using a local diff tool. When viewing the difference for a collection of files, the size limit for each file is 0.5 MB, for performance reasons.

Review updates

Review previous versions of the code from the All updates drop-down list.

PR updates

Every update to the branch adds a new version to the list and on the Updates tab of the PR. As you select different updates, the diff view updates to show the differences between the files in each version of the PR.

You can catch up with PR updates after being away from the PR by stepping through changes made since your last review.

Browse a list of changes from the author on the Updates tab.

Browse a list of changes from the author.

View and select changes made in commits to the branch on the Commits tab.

PR commits

Make comments

Add comments to a PR to make suggestions, reply to previous comments, and point out problems with the proposed changes.

  • Comment inline in the Files tab of a PR by hovering over the line you want to comment on and selecting the comment button Comment button in a PR.

    Screenshot of comments in Azure Repos P Rs.

  • Give feedback not tied to a specific code line by commenting on the Overview tab.

  • Address the author or other reviewers directly in your comments by using @username, and reference work items by using #workitemID. You can also reference other PRs by using !pullrequestID.

Vote on changes

Use the button at upper right in the PR to vote on the PR changes. The default option is Approve, but you can select other options from the dropdown list:

Screenshot that shows P R voting options.

  • Approve: Approve the proposed changes in the PR.
  • Approve with suggestions: Approve the PR, but provide optional suggestions for improvement.
  • Wait for author: Don't approve the changes, and ask the author to review your comments. The author should let you know to review the code again after they address your concerns.
  • Reject: The changes aren't acceptable. Leave a comment in the PR to explain why.
  • Reset feedback: Remove your vote.

Reset feedback

To remove your vote from a PR, select Reset feedback from the Approve dropdown list at upper right in the PR.

Screenshot that shows selecting Reset feedback from the Approve dropdown list.

Address comments

You can make quick updates to your branch directly from the Files tab in Code on the web.

Screenshot that shows the Edit button to update code directly in Azure Repos.

Reply and resolve comments

Reply to comments and update comment status to let reviewers know how you're addressing their comments and suggestions.

  • To resolve a comment without replying, select Resolve under the comment.
  • To reply to the comment, type your response in the Write a reply field, and select Reply.
  • To reply to and resolve the comment, type your response in the Write a reply field, and select Reply & resolve.
  • Reply to specific reviewers by using @username in the reply, and reference work items by using #workitemID. You can also reference other PRs by using !pullrequestID.

New comments start in Active status. Select Resolve or Reply & resolve to update comment status to Resolved.

Update comments in Azure Repos P Rs.

More options are available in the comment resolution dropdown list:

Screenshot of more options in the comment resolution dropdown list.

  • Active: The comment is still under review.
  • Pending: The issue in this comment will be addressed, but isn't fixed yet.
  • Resolved: The issue brought up in this comment is fixed.
  • Won't fix: The suggestion in the comment is noted, but this PR won't address it.
  • Closed: Discussion for this comment is closed.

Next steps