About GitHub Codespaces in Visual Studio Code
You can use your local install of Visual Studio Code to create, manage, work in, and delete codespaces. To use GitHub Codespaces in VS Code, you need to install the Codespaces extension. For more information on setting up Codespaces in VS Code, see "Prerequisites."
By default, if you create a new codespace on GitHub.com, it will open in the browser. If you would prefer to open any new codespaces in VS Code automatically, you can set your default editor to be VS Code. For more information, see "Setting your default editor for GitHub Codespaces."
If you prefer to work in the browser, but want to continue using your existing VS Code extensions, themes, and shortcuts, you can turn on Settings Sync. For more information, see "Personalizing GitHub Codespaces for your account."
Prerequisites
To develop in a codespace directly in VS Code, you must install and sign into the Codespaces extension with your GitHub credentials. The Codespaces extension requires VS Code October 2020 Release 1.51 or later.
Use the Visual Studio Code Marketplace to install the Codespaces extension. For more information, see Extension Marketplace in the VS Code documentation.
-
VS Codeの左サイドバーで、 Remote Explorerのアイコンをクリックしてください。

-
Click Sign in to view GitHub....

-
To authorize VS Code to access your account on GitHub, click Allow.
-
Sign in to GitHub to approve the extension.
-
VS Codeの左サイドバーで、 Remote Explorerのアイコンをクリックしてください。

-
Use the "REMOTE EXPLORER" drop-down, then click GitHub Codespaces.

-
Click Sign in to view Codespaces....

-
To authorize VS Code to access your account on GitHub, click Allow.
-
Sign in to GitHub to approve the extension.
Creating a codespace in VS Code
GitHub.com上のアカウントをGitHub Codespacesの機能拡張に接続すると、新しいcodespaceを作成できます。 GitHub Codespacesの機能拡張に関する詳しい情報についてはVS Code Marketplace Marketplaceを参照してください。
ノート: 現在、VS Codeではcodespaceの作成時に開発コンテナの設定を選択することはできません。 特定の開発コンテナの設定を選択したい場合、GitHub Webインターフェースを使ってcodespaceを作成してください。 詳しい情報については、このページの上部のWeb browser(Webブラウザ)タブをクリックしてください。
-
VS Codeの左サイドバーで、 Remote Explorerのアイコンをクリックしてください。

-
追加アイコン をクリックしてください。
![Codespaces の [Create New Codespace] オプション](https://web.archive.org/web/20220820092400im_/https://docs.github.com/assets/cb-50684/images/help/codespaces/create-codespace-vscode.png)
-
開発を行いたいリポジトリ名を入力し、選択してください。

-
開発するブランチをクリックします。

-
開発コンテナの設定ファイルを選択するよう求められたら、リストからファイルを選択してください。

-
使用したいマシンタイプをクリックしてください。

注釈: 利用可能なマシンタイプの選択は、Organizationで設定されたポリシーによって、あるいはリポジトリのマシンタイプの最小仕様によって制限されていることがあります。 詳しい情報については「マシンタイプへのアクセスの制限」及び「codespaceマシンの最小仕様の設定」を参照してください。
Opening a codespace in VS Code
-
VS Codeの左サイドバーで、 Remote Explorerのアイコンをクリックしてください。

-
Under "Codespaces", click the codespace you want to develop in.
-
Click the Connect to Codespace icon.

Changing the machine type in VS Code
通常、codespaceは2コアから32コアでリモートのマシンを選択して実行できます。 これらはそれぞれ、異なるレベルのリソースと支払い層を持っています。 詳しい情報については「GitHub Codespacesの支払いについて」を参照してください。
codespaceを作成したとき、デフォルトでは有効な最小リソースを持つマシンタイプが使われます。 You can change the machine type of your codespace at any time.
-
In VS Code, open the Command Palette (
shift command P/shift control P). -
Search for and select "Codespaces: Change Machine Type."

-
Click the codespace that you want to change.

-
Choose the machine type you want to use.
Note: 利用可能なマシンタイプの選択は、Organizationで設定されたポリシーによって、あるいはリポジトリのマシンタイプの最小仕様によって制限されていることがあります。 詳しい情報については「マシンタイプへのアクセスの制限」及び「codespaceマシンの最小仕様の設定」を参照してください。
-
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 VS Code
codespaceで作業をしていないときは、VS Code内からcodespaceを削除できます。
-
VS Codeの左サイドバーで、 Remote Explorerのアイコンをクリックしてください。

-
"GITHUB CODESPACES"の下で、削除したいcodespaceを右クリックしてください。
-
Delete Codespace(Codespaceを削除)をクリックしてください。

Switching to the Insiders build of VS Code
You can use the Insiders Build of VS Code within Codespaces.
-
In bottom left of your Codespaces window, select Settings.
-
From the list, select "Switch to Insiders Version".

-
Once selected, Codespaces will continue to open in Insiders Version.

