1
0
mirror of synced 2025-12-30 03:01:36 -05:00

Merge pull request #20956 from github/repo-sync

repo sync
This commit is contained in:
Octomerger Bot
2022-09-28 04:23:55 -07:00
committed by GitHub
5 changed files with 85 additions and 36 deletions

View File

@@ -1,7 +1,7 @@
---
title: Changing the machine type for your codespace
shortTitle: Change the machine type
intro: 'You can change the type of machine that''s running your codespace, so that you''re using resources appropriate for work you''re doing.'
intro: 'You can change the type of machine that''s running your codespace, so that you''re using resources appropriate for the work you''re doing.'
product: '{% data reusables.gated-features.codespaces %}'
versions:
fpt: '*'
@@ -23,9 +23,17 @@ type: how_to
{% data reusables.codespaces.codespaces-machine-types %} You can choose an alternative machine type either when you create a codespace or at any time after you've created a codespace.
For information on choosing a machine type when you create a codespace, see "[Creating a codespace](/codespaces/developing-in-codespaces/creating-a-codespace#creating-a-codespace)." For information on changing the machine type within {% data variables.product.prodname_vscode %}, see "[Using {% data variables.product.prodname_github_codespaces %} in {% data variables.product.prodname_vscode %}](/codespaces/developing-in-codespaces/using-github-codespaces-in-visual-studio-code#changing-the-machine-type-in-visual-studio-code)."
For information on choosing a machine type when you create a codespace, see "[Creating a codespace](/codespaces/developing-in-codespaces/creating-a-codespace#creating-a-codespace)."
## Changing the machine type in {% data variables.product.prodname_dotcom %}
## Changing the machine type
{% note %}
**Note**: {% data reusables.codespaces.codespaces-machine-type-availability %}
{% endnote %}
{% webui %}
{% data reusables.codespaces.your-codespaces-procedure-step %}
@@ -37,33 +45,64 @@ For information on choosing a machine type when you create a codespace, see "[Cr
1. Click **Change machine type**.
!['Change machine type' menu option](/assets/images/help/codespaces/change-machine-type-menu-option.png)
1. If multiple machine types are available for your codespace, choose the type of machine you want to use.
![Dialog box showing available machine types to choose](/assets/images/help/codespaces/change-machine-type-choice.png)
1. Click **Update codespace**.
{% note %}
{% endwebui %}
**Note**: {% data reusables.codespaces.codespaces-machine-type-availability %}
{% vscode %}
{% endnote %}
{% data reusables.codespaces.changing-machine-type-in-vscode %}
2. Click **Update codespace**.
{% endvscode %}
The change will take effect the next time your codespace restarts.
{% cli %}
## Force an immediate update of a currently running codespace
You can use the `gh codespace edit --machine MACHINE-TYPE-NAME` {% data variables.product.prodname_cli %} command to change the machine type of a codespace. To use this command, you'll first need to find out the available machine types for your codespace.
If you change the machine type of a codespace you are currently using, and you want to apply the changes immediately, you can force the codespace to restart.
1. To view your list of codespaces, in a terminal, enter the following command.
```
gh codespace list
```
1. Optionally, to find the current machine type for a codespace, enter the following command.
```
gh api /user/codespaces/CODESPACE-NAME
```
1. At the bottom left of your codespace window, click **{% data variables.product.prodname_codespaces %}**.
Replace `CODESPACE-NAME` with the permanent name of the codespace, for example `octocat-myrepo-gmc7`. The permanent names are listed under the **NAME** column in the list returned by `gh codespace list`.
![Click '{% data variables.product.prodname_codespaces %}'](/assets/images/help/codespaces/codespaces-button.png)
If you're prompted to request the `codespace` scope, follow the instructions in the terminal.
1. From the options that are displayed at the top of the page select **Codespaces: Stop Current Codespace**.
Details for the current machine are listed under the `machine` field.
1. To find the available machine types for a codespace, enter the following command.
```
gh api /user/codespaces/CODESPACE-NAME/machines
```
!['Suspend Current Codespace' option](/assets/images/help/codespaces/suspend-current-codespace.png)
Replace `CODESPACE-NAME` with the permanent name of the codespace, for example `octocat-myrepo-gmc7`.
1. To change the machine type for a codespace, enter the following command.
1. After the codespace is stopped, click **Restart codespace**.
```
gh codespace edit --machine MACHINE-TYPE-NAME
```
![Click 'Resume'](/assets/images/help/codespaces/resume-codespace.png)
Replace `MACHINE-TYPE-NAME` with the name of an available machine type for your codespace, for example `standardLinux32gb`.
1. Using the arrow keys, navigate to the codespace you want to change, then press <kbd>Enter</kbd>.
{% endcli %}
{% data reusables.codespaces.about-changing-storage-size %}
{% cli %}
## Further reading
- "[Codespaces machines](/rest/codespaces/machines)" in the REST API documentation
- [`gh codespace edit`](https://cli.github.com/manual/gh_codespace_edit) in the {% data variables.product.prodname_cli %} manual
{% endcli %}

View File

@@ -78,28 +78,15 @@ Use the {% data variables.product.prodname_vscode_marketplace %} to install the
{% data reusables.codespaces.codespaces-machine-types %} You can change the machine type of your codespace at any time.
1. In {% data variables.product.prodname_vscode_shortname %}, open the Command Palette (`shift command P` / `shift control P`).
1. Search for and select "Codespaces: Change Machine Type."
{% note %}
![Searching for a branch to create a new {% data variables.product.prodname_codespaces %}](/assets/images/help/codespaces/vscode-change-machine-type-option.png)
**Note**: {% data reusables.codespaces.codespaces-machine-type-availability %}
1. Click the codespace that you want to change.
{% endnote %}
![Searching for a branch to create a new {% data variables.product.prodname_codespaces %}](/assets/images/help/codespaces/vscode-change-machine-choose-repo.png)
{% data reusables.codespaces.changing-machine-type-in-vscode %}
1. Choose the machine type you want to use.
{% note %}
**Note**: {% data reusables.codespaces.codespaces-machine-type-availability %}
{% endnote %}
1. If the codespace is currently running, a message is displayed asking if you would like to restart and reconnect to your codespace now.
Click **Yes** if you want to change the machine type used for this codespace immediately.
If you click **No**, or if the codespace is not currently running, the change will take effect the next time the codespace restarts.
{% data reusables.codespaces.about-changing-storage-size %}
## Deleting a codespace in {% data variables.product.prodname_vscode_shortname %}

View File

@@ -31,6 +31,7 @@ You can work with {% data variables.product.prodname_github_codespaces %} in the
- [Modify ports in a codespace](#modify-ports-in-a-codespace)
- [Access codespace logs](#access-codespace-logs)
- [Access remote resources](#access-remote-resources)
- [Change the machine type of a codespace](#change-the-machine-type-of-a-codespace)
## Installing {% data variables.product.prodname_cli %}
@@ -206,4 +207,12 @@ You can use the {% data variables.product.prodname_cli %} extension to create a
**Note**: The {% data variables.product.prodname_cli %} extension is currently in beta and subject to change.
{% endnote %}
{% endnote %}
### Change the machine type of a codespace
```shell
gh codespace edit -m <em>machine-type-name</em>
```
For more information, see the "{% data variables.product.prodname_cli %}" tab of "[Changing the machine type for your codespace](/codespaces/customizing-your-codespace/changing-the-machine-type-for-your-codespace)."

View File

@@ -0,0 +1,3 @@
If you changed to a virtual machine with a different storage capacity (for example, from 64GB to 32GB), your codespace will be unavailable for a short time while the machine type is changed. If the codespace is currently active, it will automatically be stopped. When the change is complete, you'll be able to restart the codespace running on the new machine type.
If you changed to a virtual machine with the same storage capacity, the change will be applied the next time you restart the codespace. An active codespace will not be stopped automatically. For more information on restarting a codespace, see "[Stopping and starting a codespace](/codespaces/developing-in-codespaces/stopping-and-starting-a-codespace#restarting-a-codespace)."

View File

@@ -0,0 +1,11 @@
1. In {% data variables.product.prodname_vscode_shortname %}, open the Command Palette with <kbd>Command</kbd>+<kbd>Shift</kbd>+<kbd>P</kbd> (Mac) or <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>P</kbd> (Windows/Linux).
1. Search for and select "Codespaces: Change Machine Type."
![Searching for a branch to create a new {% data variables.product.prodname_codespaces %}](/assets/images/help/codespaces/vscode-change-machine-type-option.png)
1. If you're not following these instructions within a codespace, click the codespace that you want to change.
![Searching for a branch to create a new {% data variables.product.prodname_codespaces %}](/assets/images/help/codespaces/vscode-change-machine-choose-repo.png)
If you are following these instructions in a codespace, the change will apply to the codespace you're working in.
1. Select the machine type you want to use.
1. If you're changing to a machine type with a different storage capacity, a prompt will appear asking if you would like to continue. Read the prompt and click **Yes** to accept.