Tutorial: Open a project from a repo

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

If you haven't already installed Visual Studio, go to the Visual Studio downloads page to install it for free.

If you haven't already installed Visual Studio, go to the Visual Studio downloads page to install it for free.

Open a project from a GitHub repo

  1. Open Visual Studio 2017.

  2. From the top menu bar, choose File > Open > Open from Source Control.

    The Team Explorer - Connect pane opens.

    The Team Explorer window within the Visual Studio IDE

  3. In the Local Git Repositories section, choose Clone.

    Choose Clone from the Local Git Repositories section

  4. In the box that says Enter the URL of a Git repo to clone, type or paste the URL for your repo, and then press Enter. (You might receive a prompt to sign in to GitHub; if so, do so.)

    After Visual Studio clones your repo, Team Explorer closes and Solution Explorer opens. A message appears that says Click on Solutions and Folders above to view a list of Solutions. Choose Solutions and Folders.

    Choose "Solutions and Folders" from the Solution Explorer

  5. If you have a solution file available, it will appear in the "Solutions and Folders" fly-out menu. Choose it, and Visual Studio opens your solution.

    Choose what you want to open from the Solution Explorer drop-down list

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

Review your work

View the following animation to check the work that you completed in the previous section.

Animation of opening a project in a GitHub repo by using Visual Studio

  1. Open Visual Studio 2019.

  2. On the start window, choose Clone or check out code.

    View the 'Create a new project' window

  3. Enter or type the repository location, and then choose Clone.

    View the 'Clone or checkout code' window

    Visual Studio opens the project from the repo.

  4. If you have a solution file available, it will appear in the "Solutions and Folders" fly-out menu. Choose it, and Visual Studio opens your solution.

    Choose what you want to open from the Solution Explorer drop-down list

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

Open a project from an Azure DevOps repo

  1. Open Visual Studio 2017.

  2. From the top menu bar, choose File > Open > Open from Source Control.

    The Team Explorer - Connect pane opens.

    The Team Explorer window within the Visual Studio IDE

  3. Here are two ways to connect to your Azure DevOps repo:

    • In the Hosted Service Providers section, choose Connect....

      The Hosted Service Providers section of the Team Explorer window within the Visual Studio IDE

    • In the Manage Connections drop-down list, choose Connect to a Project....

      The Manage Connections section of the Team Explorer window within the Visual Studio IDE

  4. In the Connect to a Project dialog box, choose the repo that you want to connect to, and then choose Clone.

    The "Connect to a Project" dialog box that's generated from Visual Studio

    Note

    What you see in the list box depends on the Azure DevOps repositories that you have access to.

  5. After Visual Studio clones your repo, Team Explorer closes and Solution Explorer opens. A message appears that says Click on Solutions and Folders above to view a list of Solutions. Choose Solutions and Folders.

    The "Solutions and Folders" notification from Team Explorer in Visual Studio

    A solution file (specifically, a .sln file), will appear in the "Solutions and Folders" fly-out menu. Choose it, and Visual Studio opens your solution.

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

  1. Open Visual Studio 2019.

  2. On the start window, choose Clone or check out code.

    View the 'Create a new project' window

  3. In the Browse a repository section, choose Azure DevOps.

    View the 'Clone or check out code' window

    If you see a sign-in window, sign in to your account.

  4. In the Connect to a Project dialog box, choose the repo that you want to connect to, and then choose Clone.

    The "Connect to a Project" dialog box that's generated from Visual Studio

    Note

    What you see in the list box depends on the Azure DevOps repositories that you have access to.

    Visual Studio opens Team Explorer and a notification appears when the clone is complete.

    The Team Explorer window in Visual Studio after clone is complete

  5. To view your folders and files, choose the Show Folder View link.

    The Solutions section of the Team Explorer window in Visual Studio after clone is complete

    Visual Studio opens Solution Explorer.

  6. Choose the Solutions and Folders link to search for a solution file (specifically, a .sln file) to open.

    The "Solutions and Folders" notification from Team Explorer in Visual Studio

    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.

Next steps

If you're ready to code with Visual Studio, dive into any of the following language-specific tutorials:

See also