3.6 KiB
title, intro, permissions, redirect_from, versions, type, topics
| title | intro | permissions | redirect_from | versions | type | topics | |||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Creating a codespace | You can create a codespace for a branch in a repository to develop online. | Anyone can create a codespace for any public repository, or for any repository owned by their user account. |
|
|
how_to |
|
{% data reusables.codespaces.release-stage %}
About codespace creation
You can create a codespace on either {% data variables.product.prodname_dotcom_the_website %} or in {% data variables.product.prodname_vscode %}. {% data reusables.codespaces.codespaces-are-personal %}
Codespaces are associated with a specific branch of a repository and the repository cannot be empty. {% data reusables.codespaces.concurrent-codespace-limit %} For more information, see "Deleting a codespace."
When you create a codespace, a number of steps happen to enable full access to your development environment.
- Resources such as a VM and storage for your container are assigned. A new VM is created every time you create or start a codespace to ensure that you always have the latest versions and security patches.
- {% data variables.product.prodname_codespaces %} recieves information about your repository, branch, commits, your public dotfiles repository, and any secrets that you have created.
- {% data variables.product.prodname_codespaces %} executes a shallow clone of the repository.
- If you have one in your repository, {% data variables.product.prodname_codespaces %} runs the
devcontainer.jsonfile. For more information, see "Configuring {% data variables.product.prodname_codespaces %} for your project." - Your Docker container,
docker-compose, or other initialization is run. - At this point, the codespace is marked as available and you can connect.
- Once the codespace is made available, depending on the commands in the devcontainer, the codespace will continue with some set up.
- The codespace shares ports added in the
devcontainer.jsonfile. - The codespace runs anything specified in
postCreateCommand. - {% data variables.product.prodname_codespaces %} clones your dotfiles repository to the codespaces environment and looks for an install file. For more information, see "Personalizing {% data variables.product.prodname_codespaces %} for your account."
- Finally, the codespace does a full clone of the repo so you have full access to it.
- The codespace shares ports added in the
{% data reusables.codespaces.use-visual-studio-features %}
{% data reusables.codespaces.you-can-see-all-your-codespaces %}
Creating a codespace
{% data reusables.repositories.navigate-to-repo %} 2. Under the repository name, use the "Branch" drop-down menu, and select the branch you want to create a codespace for.
- Under the repository name, use the {% octicon "download" aria-label="The download icon" %} Code drop-down menu, and select Open with Codespaces.
- To create a codespace using a Standard machine type, click {% octicon "plus" aria-label="The plus icon" %} New codespace.


