1
0
mirror of synced 2025-12-21 10:57:10 -05:00

[MERGE 8/11 @ 8:45am PT] Codespaces Megabranch (#20378)

Adding Codespaces docs
This commit is contained in:
Amy Burns
2021-08-11 11:46:35 -04:00
committed by GitHub
parent 7cb7045db1
commit acabc37604
112 changed files with 1152 additions and 365 deletions

View File

@@ -0,0 +1,60 @@
---
title: Changing the machine type for your codespace
shortTitle: Changing 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.
product: '{% data reusables.gated-features.codespaces %}'
versions:
free-pro-team: '*'
topics:
- Codespaces
---
## About machine types
{% note %}
**Note:** You can only select or change the machine type if you are a member of an organization using {% data variables.product.prodname_codespaces %} and are creating a codespace on a repository owned by that organization.
{% endnote %}
{% data reusables.codespaces.codespaces-machine-types %}
You can choose a machine type either when you create a codespace or you can change the machine type 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_codespaces %} in {% data variables.product.prodname_vscode %}](/codespaces/developing-in-codespaces/using-codespaces-in-visual-studio-code#changing-the-machine-type-in-visual-studio-code)."
## Changing the machine type in {% data variables.product.prodname_dotcom %}
{% data reusables.codespaces.your-codespaces-procedure-step %}
The current machine type for each of your codespaces is displayed.
!['Your codespaces' list](/assets/images/help/codespaces/your-codespaces-list.png)
1. Click the ellipsis (**...**) to the right of the codespace you want to modify.
1. Click **Change machine type**.
!['Change machine type' menu option](/assets/images/help/codespaces/change-machine-type-menu-option.png)
1. Choose the required machine type.
2. Click **Update codespace**.
The change will take effect the next time your codespace restarts.
## Force an immediate update of a currently running 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. At the bottom left of your codespace window, click **{% data variables.product.prodname_codespaces %}**.
![Click '{% data variables.product.prodname_codespaces %}'](/assets/images/help/codespaces/codespaces-button.png)
1. From the options that are displayed at the top of the page select **Codespaces: Stop Current Codespace**.
!['Suspend Current Codespace' option](/assets/images/help/codespaces/suspend-current-codespace.png)
1. After the codespace is stopped, click **Restart codespace**.
![Click 'Resume'](/assets/images/help/codespaces/resume-codespace.png)

View File

@@ -1,7 +1,8 @@
---
title: Creating a codespace
intro: You can create a codespace for a branch in a repository to develop online.
permissions: 'Anyone can create a codespace for any public repository, or for any repository owned by their user account.'
product: '{% data reusables.gated-features.codespaces %}'
permissions: '{% data reusables.codespaces.availability %}'
redirect_from:
- /github/developing-online-with-github-codespaces/creating-a-codespace
- /github/developing-online-with-codespaces/creating-a-codespace
@@ -14,8 +15,6 @@ topics:
- Developer
---
{% data reusables.codespaces.release-stage %}
## About codespace creation
You can create a codespace on either {% data variables.product.prodname_dotcom_the_website %} or in {% data variables.product.prodname_vscode %}. {% data reusables.codespaces.codespaces-are-personal %}
@@ -23,25 +22,43 @@ You can create a codespace on either {% data variables.product.prodname_dotcom_t
Codespaces are associated with a specific branch of a repository and the repository cannot be empty. {% data reusables.codespaces.concurrent-codespace-limit %} For more information, see "[Deleting a codespace](/github/developing-online-with-codespaces/deleting-a-codespace)."
When you create a codespace, a number of steps happen to enable full access to your development environment.
When you create a codespace, a number of steps happen to create and connect you 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.
- {% data variables.product.prodname_codespaces %} receives information about your repository, branch, commits, your public dotfiles repository, and any secrets that you have created.
- {% data variables.product.prodname_codespaces %} executes a shallow clone of the repository.
- If you have one in your repository, {% data variables.product.prodname_codespaces %} runs the `devcontainer.json` file. For more information, see "[Configuring {% data variables.product.prodname_codespaces %} for your project](/github/developing-online-with-codespaces/configuring-codespaces-for-your-project)."
- 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.json` file.
- The codespace runs anything specified in `postCreateCommand`.
- {% data variables.product.prodname_codespaces %} clones your dotfiles repository to the codespaces environment and looks for an install file. For more information, see "[Personalizing {% data variables.product.prodname_codespaces %} for your account](/github/developing-online-with-codespaces/personalizing-codespaces-for-your-account)."
- Finally, the codespace does a full clone of the repo so you have full access to it.
- Step 1: VM and storage are assigned to your codespace.
- Step 2: Container is created and your repository is cloned.
- Step 3: You can connect to the codespace.
- Step 4: Codespace continues with post-creation setup.
For more information on what happens when you create a codespace, see "[Deep Dive](/codespaces/getting-started/deep-dive)."
{% data reusables.codespaces.use-visual-studio-features %}
{% data reusables.codespaces.you-can-see-all-your-codespaces %}
## Access to {% data variables.product.prodname_codespaces %}
{% data reusables.codespaces.availability %}
When you have access to {% data variables.product.prodname_codespaces %}, you'll see a "Codespaces" tab within the **{% octicon "code" aria-label="The code icon" %} Code** drop-down menu when you view a repository.
You'll have access to codespaces under the following conditions:
* You are a member of an organization that has enabled {% data variables.product.prodname_codespaces %} and set a spending limit.
* An organization owner has granted you access to {% data variables.product.prodname_codespaces %}.
* The repository is owned by the organization that has enabled {% data variables.product.prodname_codespaces %}.
{% note %}
**Note:** Individuals who have already joined the beta with their personal {% data variables.product.prodname_dotcom %} account will not lose access to {% data variables.product.prodname_codespaces %}, however {% data variables.product.prodname_codespaces %} for individuals will continue to remain in beta.
{% endnote %}
Organization owners can allow all members of the organization to create codespaces, limit codespace creation to selected organization members, or disable codespace creation. For more information about managing access to codespaces within your organization, see "[Enable Codespaces for users in your organization](/codespaces/managing-codespaces-for-your-organization/enabling-codespaces-for-your-organization#enable-codespaces-for-users-in-your-organization)."
Before {% data variables.product.prodname_codespaces %} can be used in an organization, an owner or billing manager must have set a spending limit. For more information, see "[About spending limits for Codespaces](/billing/managing-billing-for-github-codespaces/managing-spending-limits-for-codespaces#about-spending-limits-for-codespaces)."
If you would like to create a codespace for a repository owned by your personal account or another user, and you have permission to create repositories in an organization that has enabled {% data variables.product.prodname_codespaces %}, you can fork user-owned repositories to that organization and then create a codespace for the fork.
## Creating a codespace
{% data reusables.repositories.navigate-to-repo %}
@@ -49,10 +66,9 @@ When you create a codespace, a number of steps happen to enable full access to y
![Branch drop-down menu](/assets/images/help/codespaces/branch-drop-down.png)
3. Under the repository name, use the {% octicon "download" aria-label="The download icon" %} **Code** drop-down menu, and select **Open with Codespaces**.
![Open with Codespaces button](/assets/images/help/codespaces/open-with-codespaces-button.png)
4. To create a codespace using a Standard machine type, click {% octicon "plus" aria-label="The plus icon" %} **New codespace**.
3. Under the repository name, use the **{% octicon "code" aria-label="The code icon" %} Code** drop-down menu, and in the **Codespaces** tab, click {% octicon "plus" aria-label="The plus icon" %} **New codespace**.
![New codespace button](/assets/images/help/codespaces/new-codespace-button.png)
If you are a member of an organization and are creating a codespace on a repository owned by that organization, you can select the option of a different machine type. From the dialog, choose a machine type and then click **Create codespace**.
![Machine type choice](/assets/images/help/codespaces/choose-custom-machine-type.png)

View File

@@ -1,7 +1,7 @@
---
title: Deleting a codespace
intro: You can delete a codespace you no longer need.
permissions: Anyone can delete a codespace owned by their user account.
product: '{% data reusables.gated-features.codespaces %}'
redirect_from:
- /github/developing-online-with-github-codespaces/deleting-a-codespace
- /github/developing-online-with-codespaces/deleting-a-codespace
@@ -14,7 +14,7 @@ topics:
- Developer
---
{% data reusables.codespaces.release-stage %}
{% data reusables.codespaces.concurrent-codespace-limit %}
@@ -24,10 +24,7 @@ topics:
{% endnote %}
1. Navigate to the repository where you created the codespace. Select **{% octicon "codespaces" aria-label="The codespaces icon" %} Codespaces** and then click {% octicon "gear" aria-label="The Settings gear" %}. This will display all {% data variables.product.prodname_codespaces %} that you have created in the repository.
![Codespaces tab](/assets/images/help/codespaces/codespaces-manage.png)
Alternatively, you can see every codespace owned by your user account at [github.com/codespaces](https://github.com/codespaces).
1. Navigate to the "Your Codespaces" page at [github.com/codespaces](https://github.com/codespaces).
2. To the right of the codespace you want to delete, click {% octicon "kebab-horizontal" aria-label="The horizontal kebab icon" %}, then click **{% octicon "trash" aria-label="The trash icon" %} Delete**
![Delete button](/assets/images/help/codespaces/delete-codespace.png)

View File

@@ -1,7 +1,8 @@
---
title: Developing in a codespace
intro: 'You can open a codespace on {% data variables.product.product_name %}, then develop using {% data variables.product.prodname_vscode %}''s features.'
permissions: Anyone can develop in a codespace owned by their user account.
product: '{% data reusables.gated-features.codespaces %}'
permissions: You can develop in codespaces you've created for repositories owned by organizations using {% data variables.product.prodname_team %} and {% data variables.product.prodname_ghe_cloud %}.
redirect_from:
- /github/developing-online-with-github-codespaces/developing-in-a-codespace
- /github/developing-online-with-codespaces/developing-in-a-codespace
@@ -14,7 +15,7 @@ topics:
- Developer
---
{% data reusables.codespaces.release-stage %}
## About development with {% data variables.product.prodname_codespaces %}
@@ -32,7 +33,7 @@ For more information on using {% data variables.product.prodname_vscode %}, see
{% data reusables.codespaces.connect-to-codespace-from-vscode %}
{% data reusables.codespaces.use-chrome %} For more information, see "[Troubleshooting your codespace](/github/developing-online-with-codespaces/troubleshooting-your-codespace)."
{% data reusables.codespaces.use-chrome %} For more information, see "[Troubleshooting Codespaces clients](/codespaces/troubleshooting/troubleshooting-codespaces-clients)."
### Personalizing your codespace
@@ -57,4 +58,4 @@ The Command Palette allows you to access and manage many features for {% data va
2. Click the name of the codespace you want to develop in.
![Name of codespace](/assets/images/help/codespaces/click-name-codespace.png)
Alternatively, you can see any active codespaces for a repository by navigating to the repository in which it was made and selecting **{% octicon "codespaces" aria-label="The codespaces icon" %} Codespaces**.
Alternatively, you can see any active codespaces for a repository by navigating to that repository and selecting **{% octicon "code" aria-label="The code icon" %} Code**. The drop-down menu will display all active codespaces for a repository.

View File

@@ -1,6 +1,7 @@
---
title: Forwarding ports in your codespace
intro: '{% data reusables.codespaces.about-port-forwarding %}'
product: '{% data reusables.gated-features.codespaces %}'
versions:
fpt: '*'
redirect_from:
@@ -13,7 +14,7 @@ topics:
shortTitle: Forward ports
---
{% data reusables.codespaces.release-stage %}
## About forwarded ports
@@ -46,7 +47,7 @@ You can label a port to make the port more easily identifiable in a list.
## Sharing a port
If you want to share a forwarded port with others, you can make the port public. After you make a port public, anyone with the port's URL can view the running application without needing to authenticate.
If you want to share a forwarded port with others, you need to make the port public. After you make a port public, anyone with the port's URL can view the running application without needing to authenticate.
{% data reusables.codespaces.navigate-to-ports-tab %}
1. Right click the port you want to share, then click **Make Public**.

View File

@@ -1,6 +1,7 @@
---
title: Developing in a codespace
intro: 'Create a codespace to get started with developing your project inside a dedicated cloud environment. You can use forwarded ports to run your application and even use codespaces inside {% data variables.product.prodname_vscode %}'
product: '{% data reusables.gated-features.codespaces %}'
versions:
fpt: '*'
topics:
@@ -9,8 +10,10 @@ children:
- /creating-a-codespace
- /developing-in-a-codespace
- /using-source-control-in-your-codespace
- /using-codespaces-for-pull-requests
- /deleting-a-codespace
- /forwarding-ports-in-your-codespace
- /changing-the-machine-type-for-your-codespace
- /using-codespaces-in-visual-studio-code
---
{% data reusables.codespaces.release-stage %}

View File

@@ -0,0 +1,42 @@
---
title: Using Codespaces for pull requests
shortTitle: Pull requests
intro: 'You can use {% data variables.product.prodname_codespaces %} in your development workflow to create pull requests, review pull requests, and address review comments.'
product: '{% data reusables.gated-features.codespaces %}'
versions:
fpt: '*'
type: how_to
topics:
- Codespaces
- Visual Studio Code
- Developer
---
## About pull requests in {% data variables.product.prodname_codespaces %}
{% data variables.product.prodname_codespaces %} provides you with many of the capabilities you might need to work with pull requests:
- [Create a pull request](/codespaces/developing-in-codespaces/using-source-control-in-your-codespace#raising-a-pull-request) - Using either the Terminal and Git commands or the Source Control view, you can create pull requests just as you would on {% data variables.product.prodname_dotcom_the_website %}. If the repository uses a pull request template, you'll be able to use this within the Source Control view.
- [Open a pull request](#opening-a-pull-request-in-codespaces) You can open an existing pull request in a codespace, provided you have codespace access to the branch that is being merged in.
- [Review a pull request](#reviewing-a-pull-request-in-codespaces) - Once you have opened a pull request in a codespace, you can use the "GitHub Pull Request" view to add review comments and approve pull requests. You can also use {% data variables.product.prodname_codespaces %} to [view review comments](#view-comments-from-a-review-in-codespaces).
## Opening a pull request in {% data variables.product.prodname_codespaces %}
{% data reusables.repositories.sidebar-pr %}
2. In the list of pull requests, click the pull request you'd like to open in {% data variables.product.prodname_codespaces %}.
3. On the right-hand side of your screen, click **{% octicon "code" aria-label="The code icon" %} Code**.
4. From the {% data variables.product.prodname_codespaces %} tab, click **New codespace**.
![Option to open PR in a codespace](/assets/images/help/codespaces/open-with-codespaces-pr.png)
## Reviewing a pull request in {% data variables.product.prodname_codespaces %}
{% data reusables.codespaces.review-pr %}
For more information on reviewing a pull request, see "[Reviewing proposed changes in a pull request](/github/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/reviewing-proposed-changes-in-a-pull-request)."
## View comments from a review in {% data variables.product.prodname_codespaces %}
Once you have received feedback on a pull request, you can [open it in a codespace](#opening-a-pull-request-in-codespaces) to see the [review comments](#reviewing-a-pull-request-in-codespaces). From there you can respond to comments, add reactions, or dismiss the review.
![Option to open PR in a codespace](/assets/images/help/codespaces/incorporating-codespaces.png)

View File

@@ -1,6 +1,7 @@
---
title: Using Codespaces in Visual Studio Code
intro: 'You can develop in your codespace directly in {% data variables.product.prodname_vscode %} by connecting the {% data variables.product.prodname_github_codespaces %} extension with your account on {% data variables.product.product_name %}.'
product: '{% data reusables.gated-features.codespaces %}'
redirect_from:
- /github/developing-online-with-codespaces/using-codespaces-in-visual-studio-code
- /github/developing-online-with-codespaces/connecting-to-your-codespace-from-visual-studio-code
@@ -15,7 +16,7 @@ topics:
shortTitle: Visual Studio Code
---
{% data reusables.codespaces.release-stage %}
## Prerequisites
@@ -78,7 +79,6 @@ You can change the machine type of your codespace at any time.
3. 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)
4. Choose the machine type you want to use.
![Searching for a branch to create a new {% data variables.product.prodname_codespaces %}](/assets/images/help/codespaces/vscode-change-machine-choose-type.png)
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.

View File

@@ -1,6 +1,7 @@
---
title: Using source control in your codespace
intro: After making changes to a file in your codespace you can quickly commit the changes and push your update to the remote repository.
product: '{% data reusables.gated-features.codespaces %}'
versions:
fpt: '*'
type: how_to
@@ -11,7 +12,7 @@ topics:
shortTitle: Source control
---
{% data reusables.codespaces.release-stage %}
## About source control in {% data variables.product.prodname_codespaces %}
@@ -50,7 +51,7 @@ You can pull changes from the remote repository into your codespace at any time.
![Ellipsis button for View and More Actions](/assets/images/help/codespaces/source-control-ellipsis-button.png)
1. In the drop-down menu, click **Pull**.
If a dev container has been changed since you created the codespace you can apply the changes by rebuilding the container for the codespace. For more information, see "[Configuring Codespaces for your project](/codespaces/setting-up-your-codespace/configuring-codespaces-for-your-project#applying-changes-to-your-configuration)."
If the dev container configuration has been changed since you created the codespace, you can apply the changes by rebuilding the container for the codespace. For more information, see "[Configuring Codespaces for your project](/codespaces/setting-up-your-codespace/configuring-codespaces-for-your-project#applying-changes-to-your-configuration)."
## Setting your codespace to automatically fetch new changes