Skip to content

Commit da689c6

Browse files
authored
Merge pull request #8345 from MicrosoftDocs/main637956627752348115sync_temp
For protected CLA branch, push strategy should use PR and merge to target branch method to work around git push error
2 parents 7ccc6e0 + 3a8d45c commit da689c6

22 files changed

+111
-14
lines changed
Loading

docs/ide/reference/options-text-editor-advanced.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Options, Text Editor, Advanced
33
description: Learn how to use the Advanced dialog box to change global settings for the Visual Studio text editor.
4-
ms.date: 06/28/2022
4+
ms.date: 08/09/2022
55
ms.topic: reference
66
f1_keywords:
77
- VS.ToolsOptionsPages.Text_Editor.Advanced
@@ -53,6 +53,14 @@ Selected by default, this option adds a margin view next to the scrollbar that s
5353

5454
Selected by default, toggle to turn off auto-complete mode.
5555

56+
::: moniker range="vs-2022"
57+
58+
## Click to peek in margin
59+
60+
The **Single click** setting is selected by default. The settings you choose from allow you to customize how Peek Definition works when you use it to display the differences between Git commits. You can change the default **Single click** setting to **Double click**, or you can select **None** to turn off the [Peek Difference UI](../../version-control/git-line-staging.md#peek-difference-support).
61+
62+
::: moniker-end
63+
5664
## Word Based Suggestions in files handled by TextMate grammars
5765

5866
Visual Studio provides alternate programming language support and colorization in the editor by using [TextMate grammars](https://macromates.com/manual/en/language_grammars). When enabled, the Visual Studio auto-complete functionality is based on words typed rather than code. Toggle to turn off.

docs/ide/whats-new-visual-studio-2022.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: "What's new in Visual Studio 2022"
33
titleSuffix: ""
44
description: "Learn about the new features in Visual Studio 2022."
5-
ms.date: 07/07/2022
5+
ms.date: 08/09/2022
66
helpviewer_keywords:
77
- "Visual Studio, what's new"
88
- "what's new [Visual Studio]"
@@ -19,7 +19,7 @@ ms.workload:
1919

2020
[!INCLUDE [Visual Studio](~/includes/applies-to-version/vs-windows-only.md)]
2121

22-
**Updated for the 17.2 release.** See [full release notes](/visualstudio/releases/2022/release-notes) | View [product roadmap](/visualstudio/productinfo/vs-roadmap/)
22+
**Updated for the 17.3 release.** See [full release notes](/visualstudio/releases/2022/release-notes) | View [product roadmap](/visualstudio/productinfo/vs-roadmap/)
2323

2424
>[!div class="button"]
2525
>[Download Visual Studio 2022](https://visualstudio.microsoft.com/downloads/)
@@ -48,6 +48,10 @@ In [Visual Studio 2022](https://devblogs.microsoft.com/visualstudio/visual-studi
4848
> [!TIP]
4949
> To learn more about current and upcoming changes to the search experience in Visual Studio 2022, see the [Sneak Peek and Edit Your Code While You Search](https://devblogs.microsoft.com/visualstudio/sneak-peek-and-edit-your-code-while-you-search/) blog post.
5050
51+
### Git tooling is faster
52+
53+
**New in 17.2**: We've integrated a relatively new Git feature called the [commit graph](https://devblogs.microsoft.com/devops/supercharging-the-git-commit-graph/), which helps to improve both the performance of your Git operations and the performance of Visual Studio itself. For the latest info, see the [Supercharge your Git experience in Visual Studio 2022](https://devblogs.microsoft.com/visualstudio/supercharge-your-git-experience-in-vs/) blog post.
54+
5155
## Build modern apps
5256

5357
Visual Studio 2022 makes it quick and easy to build modern, cloud-based applications with Azure. As well, our new version also has full support for [.NET 6](https://devblogs.microsoft.com/dotnet/announcing-net-6/) and its unified framework for web, client, and mobile apps for both Windows and Mac developers. And, Visual Studio 2022 includes robust support for the C++ workload with new productivity features, C++20 tooling, and [IntelliSense](using-intellisense.md).
@@ -68,12 +72,11 @@ As well, we're updating **Hot Reload** so that you can edit either C++ or .NET p
6872

6973
From real-time & asynchronous collaboration tools to improved insights and productivity tools that seamlessly integrate with your daily workflow, Visual Studio 2022 has this and more.
7074

71-
### Multi-repo support with Git in the IDE
75+
### Git multi-repo support and line-staging support
7276

7377
If you've worked with projects hosted on different Git repositories, you might have used external tools or multiple instances of Visual Studio to connect to them. In [Visual Studio 2022](https://devblogs.microsoft.com/visualstudio/visual-studio-2022-preview-3-now-available/), you can work with a single solution that has projects in multiple repositories and contribute to them all from a single instance of Visual Studio. To learn more, see the [**Multi-repo support in Visual Studio**](https://devblogs.microsoft.com/visualstudio/multi-repo-support-in-visual-studio/) blog post.
7478

75-
> [!NOTE]
76-
> **New in 17.2**: We're continuing to add even more functionality to the Git feature set. For the latest info, see the [Supercharge your Git experience in Visual Studio 2022](https://devblogs.microsoft.com/visualstudio/supercharge-your-git-experience-in-vs/) blog post.
79+
**New in 17.3**: We continue to add even more functionality to the Git feature set. We've recently added line-staging support, also known as [interactive staging](https://git-scm.com/book/en/v2/Git-Tools-Interactive-Staging). Now, you can stage chunks of changes in your files right from the code editor, or split changes across different commits. For more information, see the [**Stage lines of code in Visual Studio**](../version-control/git-line-staging.md) page.
7780

7881
### IntelliCode improvements
7982

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
---
2+
title: Stage lines of code in Visual Studio
3+
titleSuffix: ""
4+
description: Stage multiple lines of code at one time or split changes across different commits by using Git from directly within Visual Studio.
5+
ms.date: 08/09/2022
6+
ms.topic: how-to
7+
author: TerryGLee
8+
ms.author: tglee
9+
ms.manager: jmartens
10+
ms.prod: visual-studio-windows
11+
ms.technology: vs-ide-general
12+
ms.custom: version-control
13+
monikerRange: vs-2022
14+
---
15+
# Stage lines of code in Visual Studio
16+
17+
[!INCLUDE [Visual Studio](~/includes/applies-to-version/vs-windows-only.md)]
18+
19+
Line-staging support, also known as [interactive staging](https://git-scm.com/book/en/v2/Git-Tools-Interactive-Staging), is now available in Visual Studio 2022 [version 17.3](/visualstudio/releases/2022/release-notes/). Line-staging lets you stage chunks of changes in your files right from the code editor. Line staging can also be helpful when you want to split changes across different commits.
20+
21+
:::image type="content" source="media/vs-2022/git-line-staging.png" alt-text="Screenshot of an example of line-staging support in Visual Studio 2022." lightbox="media/vs-2022/git-line-staging.png":::
22+
23+
## Color margin support
24+
25+
The first thing you might notice about line-staging support is how the editor visualizes Git changes on both the scroll bar and in the margin.
26+
27+
:::image type="content" source="media/vs-2022/git-color-margins.png " alt-text="Screenshot of the color margins in the Visual Studio 2022 editor." lightbox="media/vs-2022/git-color-margins.png":::
28+
29+
The colors and annotations make it easy to differentiate between saved and unsaved changes that you've added, deleted, or modified.
30+
31+
:::image type="content" source="media/vs-2022/git-color-margins-differentiated.png " alt-text="Screenshot of differentiated and annotated color margin examples in Visual Studio 2022." lightbox="media/vs-2022/git-color-margins-differentiated.png":::
32+
33+
> [!TIP]
34+
> You can change the colors that Visual Studio displays to help you manage changes. Go to **Tools** > **Options** > **Environment** > **Fonts and Colors** and then choose from the following options:
35+
> - Track additions in documents under source control
36+
> - Track deletions in documents under source control
37+
> - Track modifications in documents under source control
38+
>
39+
> :::image type="content" source="media/vs-2022/tools-options-fonts-colors-track-source-control.png" alt-text="Screenshot of the Options dialog box where you can change the colors Visual Studio uses for source control.":::
40+
41+
## Peek Difference support
42+
43+
Color margins are interactive. When you select a color margin, Visual Studio opens the **Peek Difference** user interface (UI) where you can view your changes in the editor without switching context. The Peek Difference UI summarizes the number of added and removed lines and makes it easy to navigate between changes by using the Up and Down arrows.
44+
45+
:::image type="content" source="media/vs-2022/git-peek-difference.png" alt-text="Screenshot of the Peek Difference user interface in Visual Studio as it relates to source control." lightbox="media/vs-2022/git-peek-difference.png":::
46+
47+
You can also access Peek Difference when you right-click a line that includes changes. A context menu appears where you can select **Peek Difference** from it. Or, you can use the **Alt**+**F8** keyboard shortcut.
48+
49+
:::image type="content" source="media/vs-2022/git-peek-difference-context-menu-inline.png" alt-text="Screenshot of the right-click context menu in Visual Studio where you can select Peek Difference." lightbox="media/vs-2022/git-peek-difference-context-menu-expanded.png":::
50+
51+
> [!NOTE]
52+
> If you prefer an inline difference view, you can use the **Settings** control in the top-right corner of the **Diff** editor to switch to **Inline mode**.
53+
>
54+
> :::image type="content" source="media/vs-2022/git-diff-inline-mode.png" alt-text="Screenshot of the Diff options available from the gear icon, where you can select the 'Inline mode' option." lightbox="media/vs-2022/git-diff-inline-mode.png":::
55+
56+
> [!TIP]
57+
> You can modify how Visual Studio interacts with code changes in the Peek Difference UI by using the **Click to peek in margin** option from **Tools** > **Options** > **Text Editor** > **Advanced**.
58+
> :::image type="content" source="media/vs-2022/text-editor-option-peek-in-margin.png" alt-text="Screenshot of the 'Click to peek in margin' setting.":::
59+
> For example, you can change the default **Single click** setting to **Double click**, or you can select **None** to turn off the Peek Difference UI.
60+
61+
## Stage chunks of code
62+
63+
You can stage any chunk of code by using the Peek Difference user interface (UI). To do so, hover over the change you want to stage and select **Stage Change**. Alternatively, use the global **Stage** button if you want to stage *all* the changes you made to a document.
64+
65+
:::image type="content" source="media/vs-2022/git-stage-change.png" alt-text="Screenshot of the Stage Change option in Visual Studio 2022." lightbox="media/vs-2022/git-stage-change.png":::
66+
67+
If you prefer a full-screen difference view, you can switch to the **Diff** editor. Here's how: select the **Promote to Document** button :::image type="icon" source="media/vs-2022/promote-document-button.png" border="false"::: on the top-right corner of the [**Peek Difference** UI](#peek-difference-support). Or, you can use the **Ctrl**+**Alt**+**Home** keyboard shortcut. All the features that the Peek Difference UI provides are also available in the **Diff** editor.
68+
69+
:::image type="content" source="media/vs-2022/git-stage-change-difference.png" alt-text="Screenshot of the Stage Change difference view in Visual Studio 2022." lightbox="media/vs-2022/git-stage-change-difference.png":::
70+
71+
## Commit staged changes
72+
73+
After you've prepared your commit by reviewing and staging the changes you want to include, you can create your commit by using the **Git Changes** window. Next, enter a commit message and then select **Commit Staged**.
74+
75+
:::image type="content" source="media/vs-2022/git-commit-staged-changes-inline.png" alt-text="Screenshot of the Git Changes dialog in Visual Studio 2022." lightbox="media/vs-2022/git-commit-staged-changes-expanded.png":::
76+
77+
## Next steps
78+
79+
To continue your journey, visit the [Push to remote](git-push-remote.md) page.
80+
81+
## See also
82+
83+
- [Git experience in Visual Studio](git-with-visual-studio.md)
84+
- [Visual Studio & GitHub: Better together](https://visualstudio.microsoft.com/vs/github/)

docs/version-control/git-make-commit.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Make a Git commit in Visual Studio
33
titleSuffix: ""
44
description: Make a Git commit in Visual Studio by using Git providers such as GitHub or Azure DevOps.
5-
ms.date: 11/10/2021
5+
ms.date: 08/09/2022
66
ms.topic: how-to
77
author: TerryGLee
88
ms.author: tglee
@@ -15,7 +15,7 @@ ms.custom: version-control
1515

1616
[!INCLUDE [Visual Studio](~/includes/applies-to-version/vs-windows-only.md)]
1717

18-
The core part of any Git workflow is modifying files and committing the changes in those files. While this article references GitHub repositories, you can work remotely with the Git provider of your choice, such as GitHub or Azure DevOps. Or, you can work locally with no provider at all.
18+
The core part of any Git workflow is modifying files and committing the changes in those files. While this article references GitHub repositories, you can work remotely with the Git provider of your choice, such as GitHub or Azure DevOps. Or, you can work locally with no provider at all.
1919

2020
Git tracks file changes in your repo as you work, and separates the files in your repo into three categories. These changes are equivalent to what you would see when you enter the `git status` command in the command line:
2121

@@ -47,7 +47,7 @@ When you double-click a **Commit**, Visual Studio opens its details in a separat
4747

4848
## Next steps
4949

50-
To continue your journey, visit the [Push to remote](git-push-remote.md) page.
50+
To continue your journey, visit the [Stage lines of code](git-line-staging.md) page.
5151

5252
## See also
5353

docs/version-control/index.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ metadata:
77
title: Version control & source control with Git docs # Required; page title displayed in search results. Include the brand. < 60 chars.
88
description: Use version / source control technologies in Visual Studio. You can share, integrate, and manage your code releases in Git & GitHub without leaving your codebase.
99
ms.topic: landing-page
10-
ms.date: 07/11/2022
10+
ms.date: 08/09/2022
1111
author: TerryGLee
1212
ms.author: tglee
1313
manager: jmartens
@@ -41,6 +41,8 @@ landingContent:
4141
url: git-create-branch.md
4242
- text: Make a commit
4343
url: git-make-commit.md
44+
- text: Stage lines of code
45+
url: git-line-staging.md
4446
- text: Push to remote
4547
url: git-push-remote.md
4648
- text: Fetch, pull, and sync
@@ -79,8 +81,6 @@ landingContent:
7981
url: https://devblogs.microsoft.com/visualstudio/vs2022-performance-enhancements-git-branch-switching/
8082
- text: Supercharge your Git experience (blog)
8183
url: https://devblogs.microsoft.com/visualstudio/supercharge-your-git-experience-in-vs/
82-
- text: Line-staging support (blog)
83-
url: https://devblogs.microsoft.com/visualstudio/line-staging-interactive-staging/
8484
- text: Release notes
8585
url: /visualstudio/releases/2022/release-notes-preview
8686
- text: Videos and more...
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading

docs/version-control/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
href: git-create-branch.md
2020
- name: Make a commit
2121
href: git-make-commit.md
22+
- name: Stage lines of code
23+
href: git-line-staging.md
2224
- name: Push to remote
2325
href: git-push-remote.md
2426
- name: Fetch, pull, and sync

docs/xaml-tools/xaml-live-preview.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ The initial release of Visual Studio 2022 supports the following platforms and d
101101
|---------|---------|---------|
102102
|WPF |Yes |Yes |
103103
|UWP |Yes |Yes |
104-
|WinUI3 desktop |No |Yes |
105-
|MAUI (Android Emulator) |No |Yes (px*) |
104+
|WinUI3 desktop |Yes |Yes |
105+
|.NET MAUI|Yes |Yes |
106106
|Xamarin 5.0+ (Android Emulator) |No |Yes (px*) |
107107

108108
> [!NOTE]

0 commit comments

Comments
 (0)