Freigeben über


Review pull requests

Azure DevOps Services | Azure DevOps Server | Azure DevOps Server 2022 | Azure DevOps Server 2020

When you create a pull request (PR) and specify required/optional reviewers, Azure Repos will notify the reviewers that your PR is ready for review. All required reviewers must approve the changes in your PR before the changes can merge into the target branch. For PRs that change critical branches like the main branch, your team might have created branch policies that specify the reviewers or require a minimum number of reviewers. If branch policies add optional reviewers to your PR, you can keep them, require them, or remove them. If branch policies add required reviewers to your PR, you can't make them optional or remove them. For information about assigning reviewers through branch policies, see Automatically include code reviewers.

If you're reviewing a PR, try to give constructive feedback that's precise and easy to understand. For more information on review feedback, see Pull request feedback. This article describes how to review pull requests in Azure DevOps.

You can only review Azure DevOps PRs in the web portal by using your browser.

Prerequisites

Review changes

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.

Note

The different changes between Azure DevOps Pull request and Azure DevOps Branch compare is caused by the different comparison methods.

There are two comparison methods for git diff command: Two-dot (git diff A..B) and three-dot (git diff A...B). By default, Pull Requests show a three-dot diff while the Branch Comparison instead shows a two-dot diff.

For example:

      C---D---E branch
     /
A---B---F---G   master

Pull Requests: git diff branch...master will produce only C, D, E commits. Branch Compare: git diff branch..master will produce C, D, E, F, G commits.

For more details, see three-dot-and-two-dot-git-diff-comparisons and git diff

Screenshot of a file diff view in the Files tab of an Azure Repos PR.

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.

Screenshot showing PR updates in the Files tab of an Azure Repos PR.

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.

Screenshot showing a list of commits in the Commits tab of an Azure Repos PR.

Use comments

Edit, delete, or like a comment

To edit or delete your comment, hover over the comment and select the pencil icon to edit the comment or the garbage icon to delete the comment.

To like your own or someone else's comment, hover over the comment and select the thumbs-up icon. Comments with likes show a filled in icon and the number of likes in the comment list. Hover over the icon to see the list of people who liked the comment.

Screenshot showing the edit, delete, and like buttons in a P R comment.

Filter comments

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.

Vote on PR changes

Next steps