Skip to main content

Developing in a codespace

Note

Codespaces is not available on subdomains of GHE.com, such as octocorp.ghe.com.

Developing in a codespace

You can work in a codespace using your browser, Visual Studio Code, or in a command shell.

Creating a codespace for a repository

You can create a codespace for a branch in a repository to develop online.

Creating a codespace from a template

If you're starting a new project, you can create a codespace from a blank template or choose a template specially designed for the type of work you want to do.

Deleting a codespace

You can delete a codespace you no longer need.

Opening an existing codespace

You can reopen a codespace that you have closed or stopped and return to your work.

Working collaboratively in a codespace

You can work collaboratively with other people in a codespace by using Visual Studio Live Share.

Using source control in your codespace

After making changes to a file in your codespace you can quickly commit the changes and push your update to the remote repository.

Using Codespaces for pull requests

You can use Codespaces in your web browser, or in Visual Studio Code to create pull requests, review pull requests, and address review comments.

Stopping and starting a codespace

You can stop and start your codespace to save resources and to pause work.

Forwarding ports in your codespace

You can forward ports in your codespace to test and debug your application. You can also manage the port protocol and share the port within your organization or publicly.

Rebuilding the container in a codespace

You can rebuild the dev container of a codespace you are working in to apply configuration changes. From time to time, you may want to perform a full rebuild.

Default environment variables for your codespace

sets default environment variables for each codespace.

Persisting environment variables and temporary files

You can configure custom environment variables so that they are set to the same value every time you open a codespace. You can also ensure that temporary files are not deleted when a codespace stops.

Connecting to a private network

You can connect Codespaces to resources on a private network, including package registries, license servers, and on-premises databases.

Getting started with Codespaces for machine learning

Learn about working on machine learning projects with Codespaces and its out-of-the-box tools.

Using Codespaces in Visual Studio Code

You can develop in your codespace directly in Visual Studio Code by connecting the Codespaces extension with your account.

Using Codespaces with CLI

You can work with Codespaces directly from your command line by using gh, the command line interface.