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**|
Copy file name to clipboardExpand all lines: docs/version-control/git-make-commit.md
+18-1Lines changed: 18 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,9 +40,26 @@ Visual Studio also makes it easy to commit and sync with one click by using the
40
40
41
41
:::image type="content" source="media/vs-2022/git-file-version-compare.png" alt-text="The line-by-line comparison of file versions in Visual Studio 2022.":::
42
42
43
+
:::moniker range=">=vs-2022"
44
+
43
45
New in [**version 17.6**](/visualstudio/releases/2022/release-notes-v17.6): You can also reference an issue or a pull request by typing `#` or selecting the **#** button in the lower right side of the commit message text box. For more information, see the [Reference issues and pull requests](https://devblogs.microsoft.com/visualstudio/reference-github-issues-and-pull-requests-in-visual-studio/) blog post.
44
46
45
-
New in **version 17.12**: When you rename a file, you'll see a notification bar at the top of the **Git Changes** window informing you that a file was renamed, and prompting you to stage that change. This notification appears before you stage or commit anything. You might want to stage and commit the change before making other changes, in order to ensure that Git detects the change as a rename, not a deletion and addition of a new file.
47
+
New in [**version 17.12**](/visualstudio/releases/2022/release-notes-v17.12): When you rename a file, you'll see a notification bar at the top of the **Git Changes** window informing you that a file was renamed, and prompting you to stage that change. This notification appears before you stage or commit anything. You might want to stage and commit the change before making other changes, in order to ensure that Git detects the change as a rename, not a deletion and addition of a new file.
48
+
49
+
New in **version 17.13**: With [GitHub Copilot](../ide/visual-studio-github-copilot-install-and-states.md) installed, you can have GitHub Copilot review your code changes before you commit them. To use this feature, make sure that **Tools** > **Options** > **Preview Features** > **Pull Request Comments** is enabled, and also enable **Tools** > **Options** > **GitHub** > **Copilot** > **Source Control Integration** > **Enable Git preview features**.
50
+
51
+
In the **Git Changes** window, click on the **Review changes with Copilot** button, which looks like a comment icon with a sparkle.
52
+
53
+
After a few moments, a link showing the number of code review comments appears in the **Git Changes** window that you can click on to view and navigate the comments. If no issues are detected, the message **Copilot did not comment on any files** appears.
54
+
55
+

56
+
57
+
The code review feedback shows up as comments, which show brief summary of the potential problem, and you can decide to make a change, or dismiss the comment box by using the downward arrow button on the top right of the comment box.
0 commit comments