| title | Tutorial: Open project from repo in Visual Studio | ||
|---|---|---|---|
| description | In this tutorial, 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.date | 02/27/2026 | ||
| ms.subservice | general-ide | ||
| ms.topic | tutorial | ||
| author | MikeJo5000 | ||
| ms.author | mikejo | ||
| dev_langs |
|
||
| ms.custom |
|
In this tutorial, you use Visual Studio to connect to a repository, or repo, for the first time, clone it, and then open a project from it.
In this tutorial, you learn how to:
[!div class="checklist"]
- Open a project from a GitHub repo
- Browse to an Azure DevOps repo
- If you don't have Visual Studio yet, go to Visual Studio downloads to install it for free.
::: moniker range="visualstudio"
Visual Studio makes it easy to open a project from a repo. You can do so when you start Visual Studio, or you can do so directly from within the Visual Studio IDE.
Here's how.
-
Open Visual Studio.
-
On the start window, select Clone a repository.
:::image type="content" source="media/visualstudio/clone-repository.png" alt-text="Screenshot of the Clone a Repository dialog in Visual Studio." lightbox="media/visualstudio/clone-repository.png":::
-
Enter or type the repository location, and then select Clone.
:::image type="content" source="../ide/media/vs-2022/clone-repository-enter-location.png" alt-text="Screenshot of the Clone a Repository dialog in Visual Studio where you enter a Git repo URL." lightbox="../ide/media/vs-2022/clone-repository-enter-location.png":::
-
If you're not already signed in, you might be prompted to sign into Visual Studio or your GitHub account.
[!TIP] For more information about signing in to Visual Studio, see Sign in or switch Visual Studio user accounts. For specific information about how to use your GitHub account to sign in, see Add your GitHub accounts to your Visual Studio keychain. You might receive a trust notification. For more information, see Configure trust settings for files and folders.
Visual Studio loads the solutions from the repository by using the Folder View in Solution Explorer.
:::image type="content" source="./media/visualstudio/git-solution-explorer-folder-view.png" alt-text="Screenshot of the Folder View in Solution Explorer in Visual Studio.":::
You can view a solution in Solution View by double-clicking its .sln file.
You can select Switch Views to switch between folder view and solution view.
:::image type="content" source="./media/visualstudio/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.
-
Open Visual Studio.
-
On the start window, select Open a project or solution.
Visual Studio opens an instance of File Explorer, where you can browse to your solution or project, and then select it to open it.
:::image type="content" source="./media/visualstudio/open-local-project-from-cloned-repo.png" alt-text="Screenshot of the 'Open a project or solution' window in Visual Studio.":::
[!TIP] If you opened the project or solution recently, select it from the Open recent section.
Start coding!
You can also use the Git menu or the Select Repository control in the Visual Studio IDE to interact with a repository's folders and files.
Here's how.
-
In the Visual Studio IDE, select the Git menu, and then select Clone Repository.
:::image type="content" source="./media/visualstudio/git-menu-clone-repository.png" alt-text="Screenshot of the Git menu in Visual Studio with Clone Repository selected.":::
-
Follow the prompts to connect to the Git repository that includes the files that you're looking for.
-
In the Visual Studio IDE, select the Git menu, select Local Repositories, and then select Open Local Repository.
:::image type="content" source="./media/visualstudio/git-menu-local-repositories.png" alt-text="Screenshot of the Git menu in Visual Studio with the Local Repository and Open Local Repository showing.":::
-
Follow the prompts to connect to the Git repository that has the files that you're looking for.
Here's how to browse to and clone an Azure DevOps repo by using Visual Studio.
-
Open Visual Studio.
-
On the start window, select Clone a repository.
:::image type="content" source="./media/visualstudio/clone-repository.png" alt-text="Screenshot of the Clone a Repository dialog in Visual Studio, for Azure DevOps." lightbox="./media/visualstudio/clone-repository.png":::
-
In the Browse a repository section, select Azure DevOps.
:::image type="content" source="../ide/media/vs-2022/browse-repository-azure-devops.png" alt-text="Screenshot of 'Browse a repository' in the 'Clone a repository' dialog in Visual Studio, Azure DevOps highlighted.":::
-
Follow the prompts to clone an Azure DevOps repo that includes the files that you're looking for, and then open your project.
::: moniker-end
::: moniker range="vs-2022"
Visual Studio makes it easy to open a project from a repo. You can do so when you start Visual Studio, or you can do so directly from within the Visual Studio IDE.
Here's how.
-
Open Visual Studio.
-
On the start window, select Clone a repository.
:::image type="content" source="../ide/media/vs-2022/clone-repository.png" alt-text="Screenshot of the Clone a Repository dialog in Visual Studio." lightbox="../ide/media/vs-2022/clone-repository.png":::
-
Enter or type the repository location, and then select Clone.
:::image type="content" source="../ide/media/vs-2022/clone-repository-enter-location.png" alt-text="Screenshot of the Clone a Repository dialog in Visual Studio where you enter a Git repo URL." lightbox="../ide/media/vs-2022/clone-repository-enter-location.png":::
-
If you're not already signed in, you might be prompted to sign into Visual Studio or your GitHub account.
[!TIP] For more information about signing in to Visual Studio, see Sign in or switch Visual Studio user accounts. For specific information about how to use your GitHub account to sign in, see Add your GitHub accounts to your Visual Studio keychain. You might receive a trust notification. For more information, see Configure trust settings for files and folders.
Visual Studio loads the solutions from the repository by using the Folder View in Solution Explorer.
:::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 Switch Views to switch between folder view and solution view.
:::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.
-
Open Visual Studio.
-
On the start window, select Open a project or solution.
Visual Studio opens an instance of File Explorer, where you can browse to your solution or project, and then select it to open it.
:::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 opened the project or solution recently, select it from the Open recent section.
Start coding!
You can also use the Git menu or the Select Repository control in the Visual Studio IDE to interact with a repository's folders and files.
Here's how.
-
In the Visual Studio IDE, select the Git menu, and then select Clone Repository.
:::image type="content" source="../ide/media/vs-2022/git-menu-clone-repository.png" alt-text="Screenshot of the Git menu in Visual Studio 2022 with Clone Repository selected.":::
-
Follow the prompts to connect to the Git repository that includes the files that you're looking for.
-
In the Visual Studio IDE, select the Git menu, select Local Repositories, and then select Open Local Repository.
:::image type="content" source="../ide/media/vs-2022/git-menu-local-repositories.png" alt-text="Screenshot of the Git menu in Visual Studio 2022 with the Local Repository and Open Local Repository showing.":::
-
Follow the prompts to connect to the Git repository that has the files that you're looking for.
Here's how to browse to and clone an Azure DevOps repo by using Visual Studio.
-
Open Visual Studio.
-
On the start window, select Clone a repository.
:::image type="content" source="../ide/media/vs-2022/clone-repository.png" alt-text="Screenshot of the Clone a Repository dialog in Visual Studio, for Azure DevOps." lightbox="../ide/media/vs-2022/clone-repository.png":::
-
In the Browse a repository section, select Azure DevOps.
:::image type="content" source="../ide/media/vs-2022/browse-repository-azure-devops.png" alt-text="Screenshot of 'Browse a repository' in the 'Clone a repository' dialog in Visual Studio, Azure DevOps highlighted.":::
-
Follow the prompts to clone an Azure DevOps repo that includes the files that you're looking for, and then open your project.
::: moniker-end
Feel free to dive into any of the following language-specific tutorials:
- Visual Studio tutorials | C#
- Visual Studio tutorials | Visual Basic
- Visual Studio tutorials | C++
- Visual Studio tutorials | Python
- Visual Studio tutorials | JavaScript, TypeScript, and Node.js
For more information, see:
::: moniker range=">=vs-2022"
::: moniker-end