必要な環境
Visual Studio Code の Codespaces で直接開発するには、GitHub Codespaces 機能拡張にサインインする必要があります。 GitHub Codespaces 機能拡張には、Visual Studio Code October 2020 Release 1.51 以降が必要です。
Visual Studio Marketplace を使用して、GitHub Codespaces 機能拡張をインストールします。 詳しい情報については、Visual Studio Code ドキュメントの「Extension Marketplace」を参照してください。
- Visual Studio Codeの左サイドバーで、 Remote Explorerのアイコンをクリックしてください。

- [Sign in to view GitHub...] をクリックします。
![[Signing in to view Codespaces]](/web/20210826081010im_/https://docs.github.com/assets/images/help/codespaces/sign-in-to-view-codespaces-vscode-mac.png)
- Visual Studio Code からの GitHub のアカウントへのアクセスを承認するには、[Allow] をクリックします。
- 機能拡張を承認するには、GitHub にサインインします。
- Visual Studio Codeの左サイドバーで、 Remote Explorerのアイコンをクリックしてください。

- [REMOTE EXPLORER] ドロップダウンを使用して、[GitHub Codespaces] をクリックします。

- [Sign in to view Codespaces...] をクリックします。
![[Signing in to view Codespaces]](/web/20210826081010im_/https://docs.github.com/assets/images/help/codespaces/sign-in-to-view-codespaces-vscode.png)
- Visual Studio Code からの GitHub のアカウントへのアクセスを承認するには、[Allow] をクリックします。
- 機能拡張を承認するには、GitHub にサインインします。
Visual Studio Code で Codespaces を作成する
GitHub アカウントを GitHub Codespaces 機能拡張に接続した後、GitHub または Visual Studio Code で作成した Codespaces で開発できます。
- Visual Studio Codeの左サイドバーで、 Remote Explorerのアイコンをクリックしてください。

- [Add] アイコンをクリックしてから、[Create New Codespace] をクリックします。
![Codespaces の [Create New Codespace] オプション](/web/20210826081010im_/https://docs.github.com/assets/images/help/codespaces/create-codespace-vscode.png)
- 入力し、開発するリポジトリの名前をクリックします。

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

- Click the machine type you want to develop in.

Visual Studio Code で codespace を開く
- Visual Studio Codeの左サイドバーで、 Remote Explorerのアイコンをクリックしてください。

- [Codespaces] で、開発するコードスペースをクリックします。
- [Connect to Codespace] アイコンをクリックします。
![Visual Studio Code の [Connect to Codespace] アイコン](/web/20210826081010im_/https://docs.github.com/assets/images/help/codespaces/click-connect-to-codespace-icon-vscode.png)
Changing the machine type in Visual Studio Code
codespaceは、Basic、Standard、Premiumの3種類のリモートマシンから選択して実行できます。 これらはそれぞれ、異なるレベルのリソースと支払い層を持っています。
注釈: Codespacesはベータの間、無料で利用できます。 Codespaces が一般提供されると、ストレージとコンピューティングの使用量に対して課金されます。
マシンタイプを切り替えることで、作業に最も適したリソースを柔軟に選択できます。 特待のタスクでは、様々なマシンタイプが必要になることがあります。
- ファイルの更新とPull Requestの作成に対してはBasic
- Webサイトの編集に対してはStandard
- データ分析のような高負荷のコンピューティングタスクに対してはPremium
You can change the machine type of your codespace at any time.
- In Visual Studio 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.

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.
Visual Studio Code で Codespaces を削除する
- [Codespaces] で、削除するコードスペースを右クリックします。
- ドロップダウンメニューで、[Delete Codespace] をクリックします。
