Using Codespaces in Visual Studio Code

Du kannst über Visual Studio Code direkt in Deinem Codespace entwickeln, indem Du die GitHub Codespaces-Erweiterung mit Deinem Konto auf GitHub verbindest.

Vorrausetzungen

To develop in a codespace directly in Visual Studio Code, you must sign into the GitHub Codespaces extension. The GitHub Codespaces extension requires Visual Studio Code October 2020 Release 1.51 or later.

Du kannst Visual Studio-Marketplace verwenden, um die GitHub Codespaces-Erweiterung zu installieren. Weitere Informationen findest Du unter „Marketplace-Erweiterung" in der Visual Studio Code-Dokumentation.

  1. Klicke in der linken Seitenleiste von Visual Studio Code auf das „Remote Explorer"-Symbol. Das „Remote Explorer"-Symbol in Visual Studio Code
  2. Klicke auf Sign in to view GitHub... (Anmelden zur Anzeige von...). Anmelden, um Codespaces anzuzeigen
  3. Um Visual Studio Code für den Zugriff zu Deinem Konto auf GitHub zu autorisieren, klicke auf Allow (Genehmigen).
  4. Melde Dich bei GitHub an, um die Erweiterung zu genehmigen.
  1. Klicke in der linken Seitenleiste von Visual Studio Code auf das „Remote Explorer"-Symbol. Das „Remote Explorer"-Symbol in Visual Studio Code
  2. Use the "REMOTE EXPLORER" drop-down, then click GitHub Codespaces. Die Codespaces-Kopfzeile
  3. Klicke auf Sign in to view Codespaces... (Anmelden zur Anzeige von...). Anmelden, um Codespaces anzuzeigen
  4. Um Visual Studio Code für den Zugriff zu Deinem Konto auf GitHub zu autorisieren, klicke auf Allow (Genehmigen).
  5. Melde Dich bei GitHub an, um die Erweiterung zu genehmigen.

Creating a codespace in Visual Studio Code

After you connect your GitHub account to the GitHub Codespaces extension, you can develop in a codespace that you created on GitHub or in Visual Studio Code.

  1. Klicke in der linken Seitenleiste von Visual Studio Code auf das „Remote Explorer"-Symbol. Das „Remote Explorer"-Symbol in Visual Studio Code
  2. Click the Add icon, then click Create New Codespace. The Create new Codespace option in Codespaces
  3. Type, then click the repository's name you want to develop in. Searching for repository to create a new Codespaces
  4. Click the branch you want to develop on. Searching for a branch to create a new Codespaces
  5. Click the machine type you want to develop in. Instance types for a new Codespaces

Einen Codespace in Visual Studio Code eröffnen

  1. Klicke in der linken Seitenleiste von Visual Studio Code auf das „Remote Explorer"-Symbol. Das „Remote Explorer"-Symbol in Visual Studio Code
  2. Under "Codespaces", click the codespace you want to develop in.
  3. Klicke auf das Symbol „Connect to Codespace" (Verbinde zu Codespace). Symbol „Connect to Codespace" (Verbinde mit Codespace) in Visual Studio Code

Changing the machine type in Visual Studio Code

You can run your codespace on a choice of three types of remote machine: Basic, Standard, or Premium. Each of these has a different level of resources and a different billing tier.

Note: Codespaces is free to use during the beta. When Codespaces becomes generally available, you will be billed for storage and compute usage.

Switching machine types gives you the flexibility to choose the most appropriate resources for your work. Certain tasks may require different machine types:

  • Basic for updating a file and raising a pull request
  • Standard for editing a website
  • Premium for high compute tasks such as data analysis

You can change the machine type of your codespace at any time.

  1. In Visual Studio Code, open the Command Palette (shift command P / shift control P).
  2. Search for and select "Codespaces: Change Machine Type." Searching for a branch to create a new Codespaces
  3. Click the codespace that you want to change. Searching for a branch to create a new Codespaces
  4. Choose the machine type you want to use. Searching for a branch to create a new Codespaces

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.

Deleting a codespace in Visual Studio Code

  1. Under "Codespaces", right-click the codespace you want to delete.
  2. In the drop-down menu, click Delete Codespace. Deleting a codespace in GitHub

Did this doc help you?Privacy policy

Help us make these docs great!

All GitHub docs are open source. See something that's wrong or unclear? Submit a pull request.

Make a contribution

Oder, learn how to contribute.