You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/version-control/git-create-pull-request.md
+28-3Lines changed: 28 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
title: Create a pull request in Visual Studio
3
3
titleSuffix: ""
4
4
description: Create a pull request in Visual Studio by using GitHub or Azure DevOps.
5
-
ms.date: 1/7/2025
5
+
ms.date: 1/13/2025
6
6
ms.topic: how-to
7
7
author: ghogen
8
8
ms.author: ghogen
@@ -61,18 +61,42 @@ To create a pull request, follow these steps:
61
61
62
62
With Visual Studio 17.12 and later, you can enable the **Pull Request Templates** feature (in **Tools** > **Options** > **Environment** > **Preview Features**) so that your default PR template in your repo will be used when creating a new pull request for both GitHub and Azure DevOps. Learn more about how to add a pull request template to your repository in the [GitHub documentation](https://docs.github.com/communities/using-templates-to-encourage-useful-issues-and-pull-requests/creating-a-pull-request-template-for-your-repository) and [Azure DevOps documentation](/azure/devops/repos/git/pull-request-templates#default-pull-request-templates).
63
63
64
-
## View pull request comments in the editor
64
+
## View or add pull request comments in the editor
65
65
66
-
As of Visual Studio 17.11, you can view comments and suggestions from reviewers without switching contexts to the browser.
66
+
With Visual Studio 17.11 or later, you can view comments and suggestions from reviewers without switching contexts to the browser.
To enable this feature, open **Tools** > **Options** > **Preview features** and make sure that **Pull Request Comments** is selected.
71
71
72
+
### View pull request comments
73
+
72
74
To view the comments for a pull request, check out any branch with an active pull request branch and select **Show comments in files** from the infobar. You can also select the PR number in the **Git Changes** window or from the Git top level menu with **Git** > **GitHub** or **Azure DevOps** > **Show comments in files**.
73
75
74
76

75
77
78
+
### Add pull request comments
79
+
80
+
With Visual Studio 17.13 or later, you can review a pull request, or add comments.
81
+
82
+
To enable this feature, open **Tools** > **Options** > **Preview features** and make sure that **Pull Request Comments** is selected. Once these are activated, checkout any branch with an active pull request and click on **Show comments in files** in the infobar, and navigate through the changes using the toolbar buttons above the code file.
83
+
84
+
To add a comment, click on the **Add comment** icon to the left side of the editor, as shown in the following screenshot.
85
+
86
+

87
+
88
+
You can also right-click on a line of code and, on the context menu, choose **Git** > **Add comment**.
89
+
90
+
The comment text is not published until you click the **Add Comment** button on the comment window.
91
+
92
+
You can continue the conversation on an existing comment by using the **Reply** section in the comment box. Comments are either active or resolved. You can click **Reply and Resolve** to reply to a comment and change the status to resolved in one click, or change the status using the dropdown above the comment text.
93
+
94
+
You can toggle your like status on a comment by clicking on the icon, or by clicking on the three dots, you can copy the comment text to the clipboard, copy a link to the comment to the clipboard, delete the comment, or open the comment in the web browser at the provider's site (such as github.com or your Azure DevOps project site).
95
+
96
+
The ability to add comments to a pull request is limited for some Git providers. For example, with GitHub as the provider, you can only add comments on lines within 3 lines of a change, but with the Azure DevOps provider, you can add comments at any line of a file involved in the pull request. In any case, you can only add comments on files that are included in the pull request.
97
+
98
+
### Use the keyboard
99
+
76
100
You can navigate across files and individual comments using the icons in the toolbar, or use the following keyboard shortcuts:
77
101
78
102
| Action | Keyboard shortcut |
@@ -81,6 +105,7 @@ You can navigate across files and individual comments using the icons in the too
81
105
| Go to the next file in the pull request |**Ctrl**+**Alt**+**F6**|
82
106
| Go to the previous comment |**Ctrl**+**Shift**+**Alt**+**F8**|
83
107
| Go to the next comment |**Ctrl**+**Alt**+**F8**|
108
+
| Hide comments in files |**Ctrl**+**Shift**+**F1**|
0 commit comments