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."
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.
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.
- In Visual Studio Preview, use the Tools drop-down menu, then click Options.
- Under Environment, select Preview Features and check the Connect to GitHub Codespaces preview feature.
- You will need to restart Visual Studio for the feature to be available.
- When you launch Visual Studio, the Start Window will show a Connect to a codespace button under "Get started".
- Click Connect to a codespace.
- Click Sign in to GitHub and follow the prompts, or click Create one! to create a new GitHub account and sign into the account.
- Under "Codespace details", type the repository's URL you want GitHub Codespaces to clone into your codespace.
- Optionally, use the Instance type and Suspend after drop-down menus to configure more codespace details.
- 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.
- Use the File drop-down menu, and click Connect to a Codespace.
- Under "GitHub Codespaces", click the codespace you want to connect to, then click Connect.
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.