Skip to content

Repo sync for protected branch #10410

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 16 additions & 17 deletions docs/get-started/tutorial-open-project-from-repo.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
title: "Tutorial: Open project from repo in Visual Studio"
description: Learn how to open a cloned project in a Git or Azure DevOps repository by using Visual Studio and view files in Solution Explorer.
ms.custom: vs-acquisition
ms.date: 12/04/2023
ms.date: 9/19/2024
ms.subservice: general-ide

ms.topic: tutorial
author: anandmeg
ms.author: meghaanand
Expand All @@ -14,9 +13,9 @@ dev_langs:
---
# Tutorial: Open a project from a repo

In this tutorial, you'll use Visual Studio to connect to a repository for the first time, clone it, and then open a project from it.
In this tutorial, you use Visual Studio to connect to a repository for the first time, clone it, and then open a project from it.

If you haven't already installed Visual Studio, go to the [Visual Studio downloads](https://visualstudio.microsoft.com/downloads/?cid=learn-onpage-download-cta) page to install it for free.
If you don't have Visual Studio yet, go to the [Visual Studio downloads](https://visualstudio.microsoft.com/downloads/?cid=learn-onpage-download-cta) page to install it for free.

::: moniker range="vs-2022"

Expand Down Expand Up @@ -47,13 +46,13 @@ Here's how.

1. Next, Visual Studio loads the solution(s) from the repository by using the **Folder View** in [**Solution Explorer**](../ide/use-solution-explorer.md?view=vs-2022&preserve-view=true).

:::image type="content" source="../ide/media/vs-2022/git-solution-explorer-folder-view.png" alt-text="Screenshot of the Folder View in Solution Explorer in Visual Studio 2022.":::
:::image type="content" source="./media/vs-2022/tutorial-open-project-from-repo/git-solution-explorer-folder-view.png" alt-text="Screenshot of the Folder View in Solution Explorer in Visual Studio 2022.":::

You can view a solution in **Solution View** by double-clicking its .sln file.

You can select the **Switch Views** button to switch between folder view and solution view.

Or, you can select the **Switch Views** button, and then select **Program.cs** to view a solution's code.

:::image type="content" source="./media/vs-2022/tutorial-open-project-from-repo/git-solution-explorer-switch-views.png" alt-text="Screenshot of a project in Git that's open in Solution Explorer, with the Switch Views button highlighted.":::
:::image type="content" source="./media/vs-2022/tutorial-open-project-from-repo/git-solution-explorer-switch-views.png" alt-text="Screenshot of a C# project in Git that's open in Solution Explorer":::

> [!TIP]
> You can change from the default Folder View to Solution View from the **Git** menu. Select **Settings** > **Source Control** > **Git Global Settings** > **Automatically load the solution when opening a Git repository** to do so.
Expand All @@ -69,7 +68,7 @@ Here's how.
:::image type="content" source="../ide/media/vs-2022/open-local-project-from-cloned-repo.png" alt-text="Screenshot of the 'Open a project or solution' window in Visual Studio 2022.":::

> [!TIP]
> If you've opened the project or solution recently, select it from the **Open recent** section to quickly open it again.
> If you opened the project or solution recently, select it from the **Open recent** section to quickly open it again.

Start coding!

Expand Down Expand Up @@ -117,9 +116,9 @@ Here's how to browse to and clone an Azure DevOps repo by using Visual Studio.

## Open a project from a GitHub repo with Visual Studio 2019

How you open a project from a GitHub repo by using Visual Studio depends on which version you have. Specifically, if you've installed version Visual Studio 2019 [**version 16.8**](/visualstudio/releases/2019/release-notes-history) or later, there's a new, more fully integrated [Git experience in Visual Studio](../version-control/git-with-visual-studio.md) available to you.
How you open a project from a GitHub repo by using Visual Studio depends on which version you have. Specifically, if you installed version Visual Studio 2019 [**version 16.8**](/visualstudio/releases/2019/release-notes-history) or later, there's a new, more fully integrated [Git experience in Visual Studio](../version-control/git-with-visual-studio.md) available to you.

But no matter which version you've installed, you can always open a project from a GitHub repo with Visual Studio.
But no matter which version you installed, you can always open a project from a GitHub repo with Visual Studio.

### Visual Studio 2019 version 16.8 and later

Expand Down Expand Up @@ -175,10 +174,10 @@ Here's how to use Git in Visual Studio 2019 [**version 16.8**](/visualstudio/rel

![Screenshot of the 'Open a project or solution' window in Visual Studio 2019 version 16.8 and later.](../ide/media/vs-2019/open-local-project-from-cloned-repo.png)

If you've opened the project or solution recently, select it from the **Open recent** section to quickly open it again.
If you opened the project or solution recently, select it from the **Open recent** section to quickly open it again.

> [!TIP]
> You can also use the **Git** menu in the Visual Studio IDE to open local folders and files from a repo that you've previously cloned.
> You can also use the **Git** menu in the Visual Studio IDE to open local folders and files from a repo that you previously cloned.
>
> ![Screenshot of the Git menu in Visual Studio 2019 version 16.8 and later, with the Local Repositories option expanded.](../ide/media/vs-2019/git-menu-local-repositories.png)

Expand Down Expand Up @@ -206,15 +205,15 @@ Here's how to use Git in Visual Studio 2019 [**version 16.7**](/visualstudio/rel

![Screenshot of the Solution Explorer drop-down list in Visual Studio 2019 version 16.7 and earlier.](./media/open-proj-repo-github-solutions-folders-picker.png)

If you do not have a solution file (specifically, an .sln file) in your repo, the fly-out menu says "No Solutions Found." However, you can double-click any file from the folder menu to open it in the Visual Studio code editor.
If you do not have a solution file (specifically, an .sln file) in your repo, the fly-out menu says "No Solutions Found." However, you can double-click any file from the folder menu to open it in the Visual Studio editor.

Start coding!

## Browse to an Azure DevOps repo with Visual Studio 2019

What you see when you browse to and clone an Azure DevOps repository by using Visual Studio 2019 depends on which version you have. Specifically, if you've installed version [**version 16.8**](/visualstudio/releases/2019/release-notes-history) or later, we've changed the UI to accommodate a new, more fully integrated [Git experience in Visual Studio](../version-control/git-with-visual-studio.md) in Visual Studio.
What you see when you browse to and clone an Azure DevOps repository by using Visual Studio 2019 depends on which version you have. With version [**version 16.8**](/visualstudio/releases/2019/release-notes-history) or later, the UI accommodates a new, more fully integrated [Git experience in Visual Studio](../version-control/git-with-visual-studio.md) in Visual Studio.

But no matter which version you have installed, you can always browse to and clone an Azure DevOps repo with Visual Studio.
But no matter which version you installed, you can always browse to and clone an Azure DevOps repo with Visual Studio.

### Visual Studio 2019 version 16.8 and later

Expand Down Expand Up @@ -278,7 +277,7 @@ But no matter which version you have installed, you can always browse to and clo

![Screenshot of the 'Solutions and Folders' notification from Team Explorer in Visual Studio 2019 version 16.7 and earlier.](./media/open-proj-repo-solutions-folders.png)

If you do not have a solution file in your repo, a 'No Solutions Found' message appears. However, you can double-click any file from the folder menu to open it in the Visual Studio code editor.
If you do not have a solution file in your repo, a 'No Solutions Found' message appears. However, you can double-click any file from the folder menu to open it in the Visual Studio editor.

::: moniker-end

Expand Down