1
0
mirror of synced 2025-12-22 11:26:57 -05:00
Sarah Edwards
2021-10-27 07:47:17 -07:00
committed by GitHub
parent 946cc18fa5
commit 5d700a526e
151 changed files with 35223 additions and 595 deletions

View File

@@ -18,7 +18,7 @@ topics:
## 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 %}
You can create a codespace on {% data variables.product.prodname_dotcom_the_website %}, in {% data variables.product.prodname_vscode %}, or by using {% data variables.product.prodname_cli %}. {% 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](/github/developing-online-with-codespaces/deleting-a-codespace)."
@@ -62,14 +62,52 @@ If you would like to create a codespace for a repository owned by your personal
## Creating a codespace
{% include tool-switcher %}
{% webui %}
{% 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.
![Branch drop-down menu](/assets/images/help/codespaces/branch-drop-down.png)
![Branch drop-down menu](/assets/images/help/codespaces/branch-drop-down.png)
3. Under the repository name, use the **{% octicon "code" aria-label="The code icon" %} Code** drop-down menu, and in the **Codespaces** tab, click {% octicon "plus" aria-label="The plus icon" %} **New codespace**.
![New codespace button](/assets/images/help/codespaces/new-codespace-button.png)
![New codespace button](/assets/images/help/codespaces/new-codespace-button.png)
If you are a member of an organization and are creating a codespace on a repository owned by that organization, you can select the option of a different machine type. From the dialog, choose a machine type and then click **Create codespace**.
![Machine type choice](/assets/images/help/codespaces/choose-custom-machine-type.png)
{% endwebui %}
{% vscode %}
{% data reusables.codespaces.creating-a-codespace-in-vscode %}
{% endvscode %}
{% cli %}
{% data reusables.cli.cli-learn-more %}
To create a new codespace, use the `gh codespace create` subcommand.
```shell
gh codespace create
```
You are prompted to choose a repository, a branch, and a machine type (if more than one is available).
Alternatively, you can use flags to specify some or all of the options:
```shell
gh codespace create -r <em>owner</em>/<em>repo</em> -b <em>branch</em> -m <em>machine-type</em>
```
Replace `owner/repo` with the repository identifier. Replace `branch` with the name of the branch, or the full SHA hash of the commit, that you want to be initially checked out in the codespace. If you use the `-r` flag without the `b` flag, the codespace is created from the default branch.
Replace `machine-type` with a valid identifier for an available machine type. Identifiers are strings such as: `basicLinux32gb` and `standardLinux32gb`. The type of machines that are available depends on the repository, your user account, and your location. If you enter an invalid or unavailable machine type, the available types are shown in the error message. If you omit this flag and more than one machine type is available you will be prompted to choose one from a list.
For more information about this command, see [the {% data variables.product.prodname_cli %} manual](https://cli.github.com/manual/gh_codespace_create).
{% endcli %}