Using Codespaces in Visual Studio

You can develop in your codespace directly in Visual Studio by connecting with your account on GitHub.

Codespaces is available for user accounts using GitHub Free or GitHub Pro. For more information, see "GitHub's products."

In this article

Note: Codespaces is currently in limited public beta and subject to change. During the beta period, GitHub does not make any guarantees about the availability of Codespaces. Sign up for the limited public beta. For more information about joining the beta, see "About Codespaces."

About Codespaces in Visual Studio

You can create a codespace in Visual Studio to develop applications in a Windows environment. When you use a codespace in Visual Studio, you can browse source code, build solutions, and commit changes to your repository.

You must create a codespace in Visual Studio to use it with the application. Codespaces created outside of Visual Studio can not currently be used with Visual Studio.


Before you configure a codespace in Visual Studio, you must download the latest version of Visual Studio Preview.

Enabling the connection between Visual Studio and GitHub Codespaces

Connecting to GitHub Codespaces with the Visual Studio Preview is not enabled by default, so you will first need to enable the Preview Features option.

  1. In Visual Studio Preview, use the Tools drop-down menu, then click Options.
  2. Under Environment, select Preview Features and check the Connect to GitHub Codespaces preview feature.
    Check the Connect to GitHub Codespaces preview feature
  3. You will need to restart Visual Studio for the feature to be available.

Creating a codespace in Visual Studio

  1. When you launch Visual Studio, the Start Window will show a Connect to a codespace button under "Get started".
    Visual Studio Start window with Connect to a codespace
  2. Click Connect to a codespace.
  3. Click Sign in to GitHub and follow the prompts, or click Create one! to create a new GitHub account and sign into the account.
    Visual Studio sign in to GitHub
  4. Under "Codespace details", type the repository's URL you want GitHub Codespaces to clone into your codespace.
  5. Optionally, use the Instance type and Suspend after drop-down menus to configure more codespace details.
    Visual Studio codespace details
  6. Click Create and Connect. GitHub Codespaces will begin preparing the codespace and open Visual Studio after the codespace is ready. The codespace name will appear in the remote indicator in the menu.
    Visual Studio connected to eShopOnWeb repository codespace

Opening a codespace in Visual Studio

  1. Use the File drop-down menu, and click Connect to a Codespace.
    Visual Studio File Connect to a codespace menu item
  2. Under "GitHub Codespaces", click the codespace you want to connect to, then click Connect.
    Visual Studio displaying available codespaces and details

Configuring a codespace for Visual Studio

A codespace, created with Visual Studio, can be customized through a new tool called devinit, a command line tool included with Visual Studio.


devinit lets you install additional frameworks and tools into your Windows development codespaces, modify environment variables, and more.

devinit supports a configuration file called devinit.json. You can add this file to your project if you want to create a customized and repeatable development environment. When you use devinit with a devcontainer.json file, your codespaces will be automatically configured on creation.

For more information about Windows codespace configuration and devinit, see Customize a codespace in the Visual Studio documentation. For more information about devinit, see Getting started with devinit.

Did this doc help you?

Privacy policy

Help us make these docs great!

All GitHub docs are open source. See something that's wrong or unclear? Submit a pull request.

Make a contribution

Or, learn how to contribute.