codespace の作成について
You can create a codespace on either GitHub.com or in Visual Studio Code. 各コードスペースは、作成者だけが利用できます。 他者のcodespaceで作業することはできません。
Codespaces are associated with a specific branch of a repository and the repository cannot be empty. リポジトリごと、さらにはブランチごとに1つ以上のcodespaceを作成できます。 しかし、限定パブリックベータの間は、ユーザアカウントごとに2つのcodespaceという制限があります。 この制限に達した場合に新しいcodespaceを作成したいなら、まずcodespaceを削除しなければなりません。 For more information, see "Deleting a codespace."
When you create a codespace, a number of steps happen to enable full access to your development environment.
- Resources such as a VM and storage for your container are assigned. A new VM is created every time you create or start a codespace to ensure that you always have the latest versions and security patches.
- Codespaces recieves information about your repository, branch, commits, your public dotfiles repository, and any secrets that you have created.
- Codespaces executes a shallow clone of the repository.
- If you have one in your repository, Codespaces runs the
devcontainer.jsonfile. 詳しい情報については、「プロジェクトの Codespaces を設定する」を参照してください。 - Your Docker container,
docker-compose, or other initialization is run. - At this point, the codespace is marked as available and you can connect.
- Once the codespace is made available, depending on the commands in the devcontainer, the codespace will continue with some set up.
- The codespace shares ports added in the
devcontainer.jsonfile. - The codespace runs anything specified in
postCreateCommand. - Codespaces clones your dotfiles repository to the codespaces environment and looks for an install file. For more information, see "Personalizing Codespaces for your account."
- Finally, the codespace does a full clone of the repo so you have full access to it.
- The codespace shares ports added in the
Visual Studio Codeでcodespace内で開発をする間に、コードを編集し、デバッグし、Gtiのコマンドを使うことができます。 詳しい情報についてはVisual Studio Codeのドキュメンテーションを参照してください。
作成した利用可能なすべてのcodespaceはgithub.com/codespacesで見ることができます。
codespace を作成する
-
GitHubで、リポジトリのメインページにアクセスしてください。
-
リポジトリ名の下で、[Branch] ドロップダウンメニューを使用して、codespace を作成するブランチを選択します。
![[Branch] ドロップダウンメニュー](/web/20210906023117im_/https://docs.github.com/assets/images/help/codespaces/branch-drop-down.png)
-
リポジトリ名の下で、 [Code] ドロップダウンメニューを使用して、[Open with Codespaces] を選択します。
![[Open with Codespaces] ボタン](/web/20210906023117im_/https://docs.github.com/assets/images/help/codespaces/open-with-codespaces-button.png)
-
To create a codespace using a Standard machine type, click New codespace.
![[New codespace] ボタン](/web/20210906023117im_/https://docs.github.com/assets/images/help/codespaces/new-codespace-button.png)