Skip to content

Commit b5bde33

Browse files
authored
Merge pull request #9564 from MicrosoftDocs/main
Merge to live for 17.1 release
2 parents 9f9a021 + cc69727 commit b5bde33

12 files changed

+100
-7
lines changed

docs/ide/reference/command-prompt-powershell.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,65 @@ By default, the Developer PowerShell that launches is configured for the Visual
126126
> [!TIP]
127127
> The [execution policy](/powershell/module/microsoft.powershell.core/about/about_execution_policies) must be set in order for the cmdlet to run.
128128
129+
The `Launch-VsDevShell.ps1` script works by locating the `Microsoft.VisualStudio.DevShell.dll` PowerShell module in the Visual Studio installation path, loading it, and then invoking the `Enter-VsDevShell` cmdlet. Installed shortcuts, like those in the Start Menu, load the module and invoke the cmdlet directly. `Launch-VsDevShell.ps1` is the recommended way to initialize Developer PowerShell interactively or for scripting build automation.
130+
131+
## Command line arguments
132+
133+
### Target Architecture and Host Architecture
134+
135+
For build tools -- like the C++ compiler -- that create outputs targeting specific CPU architectures the developer shells can be configured using the appropriate command line argument. The architecture of the build tool binaries can also be configured using command line arguments. This is useful when the build machine is a different architecture than the target architecture.
136+
137+
> [!TIP]
138+
> Beginning with Visual Studio 2022, `msbuild` will default to a 64-bit msbuild.exe binary, regardless of the Host Architecture.
139+
140+
|Shell|Argument|
141+
|--|--|
142+
|Developer Command Prompt|-arch=<Target Architecture>|
143+
|Developer Command Prompt|-host_arch=<Host Architecture>|
144+
|Developer PowerShell|-Arch <Target Architecture>|
145+
|Developer PowerShell|-HostArch <Host Architecture>|
146+
147+
Developer PowerShell arguments -Arch and -HostArch are only available beginning with Visual Studio 2022 Update 1.
148+
149+
The following is a list of which architectures are supported, and whether they can be used for the Target Architecture or Host Architecture arguments.
150+
151+
|Architecture|Target Architecture|Host Architecture|
152+
|--|--|--|
153+
|x86|Default|Default|
154+
|amd64|Yes|Yes|
155+
|arm|Yes|No|
156+
|arm64|Yes|No|
157+
158+
> [!TIP]
159+
> If only Target Architecure is set, the shells will attempt to make the Host Architecture match. This can result in errors when setting only the Target Architecture to a value not also supported by Host Architecture.
160+
161+
#### Examples
162+
163+
Start Developer Command Prompt for Visual Studio 2019 Community Edition on a 64-bit machine, creating build outputs that target 64-bit:
164+
```cmd
165+
"%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Community\Common7\Tools\VsDevCmd.bat" -arch=amd64
166+
```
167+
168+
Start Developer Command Prompt for Visual Studio 2019 Community Edition on a 64-bit machine, creating build outputs that target arm:
169+
```cmd
170+
"%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Community\Common7\Tools\VsDevCmd.bat" -arch=arm -host_arch=amd64
171+
```
172+
173+
Start Developer PowerShell for Visual Studio 2022 Update 1 Community Edition on 64-bit machine, creating build outputs that target arm64:
174+
```powershell
175+
& 'C:\Program Files (x86)\Microsoft Visual Studio\2022\Community\Common7\Tools\Launch-VsDevShell.ps1' -Arch arm64 -HostArch amd64
176+
```
177+
178+
### SkipAutomaticLocation
179+
180+
For Developer PowerShell, the starting directory of the shell is the Visual Studio Project Location. This will override any other paths, such as working directory. This behavior can be turned off using the
181+
command line argument `-SkipAutomaticLocation`. This is useful if, for example, you want the shell to stay in the current directory after initialization.
182+
183+
The Project Location can be adjusted in Tools -> Options -> Projects & Solutions -> Project Location.
184+
185+
> [!TIP]
186+
> The command line arguments `-Arch`, `-HostArch`, and `-SkipAutomaticLocation` are supported by both the `Launch-VsDevShell.ps1` script and the `Enter-VsDevShell` cmdlet.
187+
129188
## See also
130189

131190
- [Windows Terminal](/windows/terminal/)

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

Lines changed: 3 additions & 3 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: 01/26/2022
5+
ms.date: 02/15/2022
66
helpviewer_keywords:
77
- "Visual Studio, what's new"
88
- "what's new [Visual Studio]"
@@ -17,15 +17,15 @@ ms.workload:
1717
---
1818
# What's new in Visual Studio 2022
1919

20-
**Updated for the 17.0 GA (General Availability) release.** See [full release notes](/visualstudio/releases/2022/release-notes) | View [product roadmap](/visualstudio/productinfo/vs-roadmap/)
20+
**Updated for the 17.1 release.** See [full release notes](/visualstudio/releases/2022/release-notes) | View [product roadmap](/visualstudio/productinfo/vs-roadmap/)
2121

2222
>[!div class="button"]
2323
>[Download Visual Studio 2022](https://visualstudio.microsoft.com/downloads/)
2424
2525
With [Visual Studio 2022](https://visualstudio.microsoft.com/vs/), you'll always get the best-in-class tools and services available for any developer, any app, and any platform. Whether you're using Visual Studio for the first time or you've been using it for years, there's a lot to like in our newest version!
2626

2727
> [!TIP]
28-
> Check out the [**Visual Studio 2022 launch event**](https://www.youtube.com/watch?v=f8jXO946eDw) on our [YouTube channel](https://www.youtube.com/visualstudio). You can also catch it on our [Twitch channel](https://www.twitch.tv/visualstudio), too.
28+
> Check out the [**Visual Studio 2022 GA launch event**](https://www.youtube.com/watch?v=f8jXO946eDw) on our [YouTube channel](https://www.youtube.com/visualstudio). You can also catch it on our [Twitch channel](https://www.twitch.tv/visualstudio), too.
2929
3030
## Performance improvements
3131

docs/version-control/git-browse-repository.md

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,9 @@ ms.manager: jmartens
99
ms.prod: visual-studio-windows
1010
ms.technology: vs-ide-general
1111
---
12+
# Browse Git repositories and compare branches in Visual Studio
1213

13-
# Browse Git repos & compare commits in Visual Studio
14-
15-
The **Git Changes** window provides a seamless way to interact with Git while coding without having to switch away from your code. But there are times when it makes more sense to focus on your Git repository. For example, you might need to get a good picture of what your team has been working on or maybe compare two commits to investigate a bug.
14+
The **Git Changes** window provides a seamless way to interact with Git while coding without having to switch away from your code. But there are times when it makes more sense to focus on your Git repository. For example, you might need to get a good picture of what your team has been working on or maybe [compare two commits](#compare-commits) to investigate a bug.
1615

1716
You can work remotely with the Git provider of your choice, such as GitHub or Azure DevOps.
1817

@@ -43,6 +42,8 @@ You can browse though any local or remote branch without having to switch your b
4342
>
4443
>:::image type="content" source="media/vs-2022/git-repository-commit-details-full-screen.png" alt-text="Screenshot of full-screen commit details with diff configurations." lightbox="media/vs-2022/git-repository-commit-details-full-screen.png":::
4544
45+
<a name="compare-commits"/>
46+
4647
## Compare commits
4748

4849
To compare any two commits in your branch, use the **Ctrl** key to select the two commits that you want to compare. Then right-click one of them and select **Compare Commits**.
@@ -63,8 +64,41 @@ In Visual Studio, you can use the **Git Graph** pane in the **Git Repository** w
6364
> [!NOTE]
6465
> The equivalent command for this action is `git branch <branchname> [<commit-id>]`.
6566
67+
## Compare branches
68+
Comparing branches provides an overview of differences between two branches which can be very helpful before creating a pull request, merging, or even deleting a branch.
69+
70+
:::image type="content" source="media/vs-2022/git-compare-branches-illustration.png" alt-text="Compare branches illustration" lightbox="media/vs-2022/git-compare-branches-illustration.png":::
71+
72+
To compare your currently checked out branch with other branches using Visual Studio, you can utilize the branch picker hosted in the status bar and the Git changes tool window to choose any local or remote branch to compare with. Right click the branch you are targeting and select **Compare with Current Branch**. Alternatively, you can utilize the branch list on the Git Repository window to access the same command.
73+
74+
:::image type="content" source="media/vs-2022/git-compare-branches-entrypoints.gif" alt-text="Compare branches entrypoints":::
75+
76+
Selecting **Compare with Current Branch** opens the compare branches experience where you can navigate the **Changes** list and select the file that you would like to compare.
77+
78+
:::image type="content" source="media/vs-2022/git-compare-branches.png" alt-text="Compare branches diff view" lightbox="media/vs-2022/git-compare-branches.png":::
79+
6680
> [!TIP]
67-
> To learn how the [Preview](/visualstudio/releases/2022/release-notes-preview) version of Visual Studio 2022 makes it easy to checkout commits, see the "Checkout commits" section of the [Introducing new Git features to Visual Studio 2022](https://devblogs.microsoft.com/visualstudio/introducing-new-git-features-to-visual-studio-2022/#checkout-commits) blog post.
81+
> If you prefer an inline diff, you can use the diff configuration options gear and switch to an inline diff view.
82+
> :::image type="content" source="media/vs-2022/git-diff-configuration-options.png" alt-text="Diff configuration options":::
83+
84+
## Checkout commits
85+
Checking out a commit can be beneficial in multiple ways. For example, it allows you to go back to a previous point in your repository’s history where you can run or test your code. It can also be helpful if you would like to review code from a remote branch (a colleague’s branch, for example). That way you don’t need to create a local branch if you are not planning on contributing to it. In this case, you can just checkout the tip of the remote branch that you would like to review.
86+
87+
:::image type="content" source="media/vs-2022/git-checkout-commit-illustration.png" alt-text="Checkout commit illustration":::
88+
89+
To checkout a previous commit in Visual Studio, open the **Git Repository** window, right click on the commit you would like to go back to and select **checkout (–detach)**. Visual Studio shows a confirmation dialog explaining that by checking out a commit you will be in a detached HEAD state. Meaning that the HEAD of your repository is going to point directly to a commit instead of a branch.
90+
91+
:::image type="content" source="media/vs-2022/git-checkout-commit-entrypoints.gif" alt-text="Checkout commit entry points":::
92+
93+
Now that you are in a detached head state, feel free to run and test your code or even explore and commit changes. When you are done exploring and want to go back to your branch, you can choose to discard your changes by checking out an existing branch or choose to keep your changes by **[creating a new branch](git-create-branch.md)** first.
94+
95+
> [!IMPORTANT]
96+
> Commits created in a detached head state are not associated with any branch and may be garbage collected by Git after you checkout a branch. That is why to keep your changes, it is recommended to create a new branch before checking out a branch. For example, commits C5 and C6 will be garbage collected if we check out Main without creating a new branch.
97+
> :::image type="content" source="media/vs-2022/git-detached-head-commits-illustration.png" alt-text="Detached head commits illustration":::
98+
> To learn more about the detached head state view the following Git documentation: [Detached Head](https://git-scm.com/docs/git-checkout#_detached_head)
99+
100+
Checking out the tip of a remote branch can be helpful if you would like to quickly review a pull request and evaluate the latest updates. To do that in Visual Studio, first make sure to fetch and get the latest updates from your remote repository. Then right click on the remote branch you would like to review and select **Checkout Tip Commit**.
101+
:::image type="content" source="media/vs-2022/git-checkout-tip-commit.png" alt-text="Checkout tip commit" lightbox="media/vs-2022/git-checkout-tip-commit.png":::
68102

69103
## Next steps
70104

Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading

0 commit comments

Comments
 (0)