1
0
mirror of synced 2025-12-19 18:10:59 -05:00

Changes from JetBrains PR

These are the changes in the pre-review version of PR:
https://github.com/github/docs-internal/pull/29794

This version of the Codespaces docs forms the base for
the Universe megabranch.
This commit is contained in:
hubwriter
2022-10-06 12:48:44 +01:00
parent 7e3bc9ec8f
commit dfab0d1601
106 changed files with 1051 additions and 312 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 363 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 87 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 174 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 306 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 282 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 121 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 280 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 280 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 171 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 903 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 77 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 32 KiB

View File

@@ -11,9 +11,11 @@ const article: PlaygroundArticleT = {
'/codespaces/setting-up-your-project-for-codespaces/setting-up-your-dotnet-project-for-codespaces',
codeLanguageId: 'dotnet',
intro: dedent`
This guide shows you how to add a dev container configuration to your repository to define the GitHub Codespaces development environment for your **C# (.NET)** codebase. For more information, see "[Introduction to dev containers](/codespaces/setting-up-your-project-for-codespaces/introduction-to-dev-containers)."
This guide shows you how to add a dev container configuration to your repository to define the GitHub Codespaces development environment for your **C# (.NET)** codebase. For more information, see "[Introduction to dev containers](/codespaces/setting-up-your-project-for-codespaces/introduction-to-dev-containers)."
If you want to add a dev container configuration for another programming language, click the language button to the right.
To step through the instructions in this guide you will work on a codespace using either the Visual Studio Code desktop application or the VS Code web client.
These instructions are for C#. If you want to add a dev container configuration for another programming language, click the language button to the right.
`,
prerequisites: dedent`
- You should have an existing C# (.NET) project in a repository on GitHub.com. If you don't have a project, you can try this tutorial with the following example: https://github.com/2percentsilk/python-quickstart.

View File

@@ -13,7 +13,9 @@ const article: PlaygroundArticleT = {
intro: dedent`
This guide shows you how to add a dev container configuration to your repository to define the GitHub Codespaces development environment for your **Java** codebase. For more information, see "[Introduction to dev containers](/codespaces/setting-up-your-project-for-codespaces/introduction-to-dev-containers)."
If you want to add a dev container configuration for another programming language, click the language button to the right.
To step through the instructions in this guide you will work on a codespace using either the Visual Studio Code desktop application or the VS Code web client.
These instructions are for Java. If you want to add a dev container configuration for another programming language, click the language button to the right.
`,
prerequisites: dedent`
- You should have an existing Java project in a repository on GitHub.com. If you don't have a project, you can try this tutorial with the following example: https://github.com/microsoft/vscode-remote-try-java

View File

@@ -13,7 +13,9 @@ const article: PlaygroundArticleT = {
intro: dedent`
This guide shows you how to add a dev container configuration to your repository to define the GitHub Codespaces development environment for your **Node.js** codebase. For more information, see "[Introduction to dev containers](/codespaces/setting-up-your-project-for-codespaces/introduction-to-dev-containers)."
If you want to add a dev container configuration for another programming language, click the language button to the right.
To step through the instructions in this guide you will work on a codespace using either the Visual Studio Code desktop application or the VS Code web client.
These instructions are for Node.js. If you want to add a dev container configuration for another programming language, click the language button to the right.
`,
prerequisites: dedent`
- You should have an existing JavaScript, Node.js, or TypeScript project in a repository on GitHub.com. If you don't have a project, you can try this tutorial with the following example: https://github.com/microsoft/vscode-remote-try-node

View File

@@ -13,7 +13,9 @@ const article: PlaygroundArticleT = {
intro: dedent`
This guide shows you how to add a dev container configuration to your repository to define the GitHub Codespaces development environment for your **Python** codebase. For more information, see "[Introduction to dev containers](/codespaces/setting-up-your-project-for-codespaces/introduction-to-dev-containers)."
If you want to add a dev container configuration for another programming language, click the language button to the right.
To step through the instructions in this guide you will work on a codespace using either the Visual Studio Code desktop application or the VS Code web client.
These instructions are for Python. If you want to add a dev container configuration for another programming language, click the language button to the right.
`,
prerequisites: dedent`
- You should have an existing Python project in a repository on GitHub.com. If you don't have a project, you can try this tutorial with the following example: https://github.com/2percentsilk/python-quickstart.

View File

@@ -9,6 +9,7 @@ children:
- /understanding-billing-for-github-codespaces
- /allowing-your-codespace-to-access-a-private-image-registry
- /using-github-copilot-in-github-codespaces
- /using-the-github-codespaces-plugin-for-jetbrains
- /using-the-vs-code-command-palette-in-codespaces
- /security-in-github-codespaces
- /disaster-recovery-for-github-codespaces

View File

@@ -16,9 +16,71 @@ redirect_from:
- /codespaces/codespaces-reference/using-github-copilot-in-codespaces
---
## Using {% data variables.product.prodname_copilot %}
{% webui %}
[{% data variables.product.prodname_copilot %}](https://copilot.github.com/), an AI pair programmer, can be used in any codespace. To start using {% data variables.product.prodname_copilot %} in {% data variables.product.prodname_github_codespaces %}, install the [{% data variables.product.prodname_copilot %} extension from the {% data variables.product.prodname_vscode_marketplace %}](https://marketplace.visualstudio.com/items?itemName=GitHub.copilot).
## Using {% data variables.product.prodname_copilot %} in the {% data variables.product.prodname_vscode_shortname %} web client
To include {% data variables.product.prodname_copilot %}, or other extensions, in all of your codespaces, enable Settings Sync. For more information, see "[Personalizing {% data variables.product.prodname_github_codespaces %} for your account](/codespaces/customizing-your-codespace/personalizing-github-codespaces-for-your-account#settings-sync)." Additionally, to include {% data variables.product.prodname_copilot %} in a given project for all users, you can specify `GitHub.copilot` as an extension in your `devcontainer.json` file. For information about configuring a `devcontainer.json` file, see "[Introduction to dev containers](/codespaces/customizing-your-codespace/configuring-codespaces-for-your-project#creating-a-custom-dev-container-configuration)."
{% data reusables.codespaces.copilot-in-vscode %}
{% endwebui %}
{% vscode %}
## Using {% data variables.product.prodname_copilot %} in {% data variables.product.prodname_vscode %}
{% data reusables.codespaces.copilot-in-vscode %}
{% endvscode %}
{% jetbrains %}
## Installing {% data variables.product.prodname_copilot %} in your JetBrains IDE
[{% data variables.product.prodname_copilot %}](https://copilot.github.com/), an AI pair programmer, can be used in any codespace. For more information, see "[About GitHub Copilot](/copilot/overview-of-github-copilot/about-github-copilot)."
To use {% data variables.product.prodname_copilot %} in a codespace in your JetBrains IDE, install the [{% data variables.product.prodname_copilot %} plugin](https://plugins.jetbrains.com/plugin/17718-github-copilot) from within your codespace.
{% note %}
**Note**: You must install the {% data variables.product.prodname_copilot %} plugin each time you create a new codespace.
{% endnote %}
1. Click **JetBrains Client**, then click **Preferences**.
1. In the Preferences dialog box, click **Plugins On Host** in the navigation panel. Then click the **Marketplace** tab.
![Screenshot of the Marketplace tab for 'Plugins On Host'](/assets/images/help/codespaces/jetbrains-preferences-plugins.png)
1. In the search box, type "copilot" then click the **Install** button for the {% data variables.product.prodname_copilot %} plugin.
![Screenshot of the {% data variables.product.prodname_copilot %} plugin](/assets/images/help/codespaces/jetbrains-copilot-plugin.png)
1. Click **Accept** on the "Third-Party Plugins Privacy Note" dialog box.
1. Click **Restart IDE**.
![Screenshot of the {% data variables.product.prodname_copilot %} plugin](/assets/images/help/codespaces/jetbrains-copilot-restart.png)
1. Click **Restart** when prompted to confirm that you want to restart the backend IDE that's running remotely. The JetBrains client application will close when you do this.
1. Open the codespace again from the JetBrains Gateway application. For more information, see "[Using {% data variables.product.prodname_github_codespaces %} in your JetBrains IDE](/codespaces/developing-in-codespaces/using-github-codespaces-in-your-jetbrains-ide#opening-a-codespace-in-your-jetbrains-ide)."
1. After your JetBrains IDE has restarted, click the **Tools** menu. Click **{% data variables.product.prodname_copilot %}**, then click **Login to {% data variables.product.prodname_dotcom %}**.
![Screenshot of the JetBrains Tools menu](/assets/images/help/codespaces/jetbrains-tools-menu.png)
1. In the "Sign in to {% data variables.product.prodname_dotcom %}" dialog box, to copy the device code and open the device activation window, click **Copy and Open**.
![Screenshot of the device code copy and open](/assets/images/help/copilot/device-code-copy-and-open.png)
1. A device activation window will open in your browser. Paste the device code, then click **Continue**.
- To paste the code in Windows or Linux, press <kbd>Ctrl</kbd>+<kbd>v</kbd>.
- To paste the code in macOS, press <kbd>command</kbd>+<kbd>v</kbd>.
1. {% data variables.product.prodname_dotcom %} will request the necessary permissions for {% data variables.product.prodname_copilot %}. To approve these permissions, click **Authorize {% data variables.product.prodname_copilot %} Plugin**.
1. After the permissions have been approved, your JetBrains IDE will show a confirmation. To begin using {% data variables.product.prodname_copilot %}, click **OK**.
![Screenshot of the JetBrains IDE permissions confirmation](/assets/images/help/copilot/jetbrains-ide-confirmation.png)
## Further reading
- "[Getting started with GitHub Copilot in a JetBrains IDE](/copilot/getting-started-with-github-copilot/getting-started-with-github-copilot-in-a-jetbrains-ide)"
{% endjetbrains %}

View File

@@ -0,0 +1,63 @@
---
title: Using the GitHub Codespaces plugin for JetBrains
shortTitle: Plugin for JetBrains
intro: 'You can use the {% data variables.product.prodname_github_codespaces %} plugin to find out about your codespace or stop it when you''ve finished working.'
versions:
fpt: '*'
ghec: '*'
type: reference
topics:
- Codespaces
product: '{% data reusables.gated-features.codespaces %}'
---
## About the {% data variables.product.prodname_github_codespaces %} plugin
The {% data variables.product.prodname_github_codespaces %} plugin is already installed in the JetBrains client when you connect to a codespace from the JetBrains Gateway. The plugin adds the {% data variables.product.prodname_github_codespaces %} tool window to the user interface.
Click **{% data variables.product.prodname_github_codespaces %}** at the bottom left of the JetBrains client's application window to open the {% data variables.product.prodname_github_codespaces %} tool window.
![Screenshot of the {% data variables.product.prodname_github_codespaces %} tool window](/assets/images/help/codespaces/jetbrains-codespaces-tool-window.png)
## Using the {% data variables.product.prodname_github_codespaces %} tool window
The {% data variables.product.prodname_github_codespaces %} tool window shows:
* The repository from which you created this codespace.
* The display name of the codespace.
* The current branch.
* The machine specifications.
* The time for which this codespace can remain idle before it is automatically stopped.
* The age of the codespace.
* The period for which a stopped codespace will be retained before it is automatically deleted.
The icons at the top of the {% data variables.product.prodname_github_codespaces %} tool window provide the following functions.
* **Refresh active codespace**
![Screenshot of the refresh button](/assets/images/help/codespaces/jetbrains-plugin-icon-refresh-BAK.png)
Refresh the details in the {% data variables.product.prodname_github_codespaces %} tool window. For example, if you used {% data variables.product.prodname_cli %} to change the display name, you could click this button to show the new name.
* **Disconnect and stop**
![Screenshot of the stop button](/assets/images/help/codespaces/jetbrains-plugin-icon-stop.png)
Stop the codespace, stop the backend IDE on the remote machine, and close the local JetBrains client.
* **Manage your codespaces from the web**
![Screenshot of the list button](/assets/images/help/codespaces/jetbrains-plugin-icon-index.png)
Open your list of codespaces at https://github.com/codespaces.
* **View the codespace creation log**
![Screenshot of the log button](/assets/images/help/codespaces/jetbrains-plugin-icon-log.png)
Open the codespace creation log in the editor window. For more information, see "[GitHub Codespaces logs](/codespaces/troubleshooting/github-codespaces-logs)."
* **Rebuild the dev container**
![Screenshot of the rebuild button](/assets/images/help/codespaces/jetbrains-plugin-icon-rebuild.png)
Rebuild your codespace to apply changes you've made to the dev container configuration. The JetBrains client will close and you must reopen the codespace. For more information, see "[Codespaces lifecycle](/codespaces/developing-in-codespaces/codespaces-lifecycle#rebuilding-a-codespace)."

View File

@@ -66,3 +66,7 @@ You can use the {% data variables.product.prodname_vscode_command_palette_shortn
To retrieve the logs for {% data variables.product.prodname_github_codespaces %}, [access the {% data variables.product.prodname_vscode_command_palette_shortname %}](#accessing-the-command-palette), then start typing "log". Select **Codespaces: Export Logs** to export all logs related to {% data variables.product.prodname_github_codespaces %} or select **Codespaces: View Creation Logs** to view logs related to the setup.
![Command to access logs](/assets/images/help/codespaces/codespaces-logs.png)
## Further reading
- "[Using {% data variables.product.prodname_github_codespaces %} in {% data variables.product.prodname_vscode %}](/codespaces/developing-in-codespaces/using-github-codespaces-in-visual-studio-code)"

View File

@@ -23,7 +23,7 @@ product: '{% data reusables.gated-features.codespaces %}'
When using any development environment, customizing the settings and tools to your preferences and workflows is an important step. {% data variables.product.prodname_github_codespaces %} allows for two main ways of personalizing your codespaces.
- [Settings Sync](#settings-sync) - You can use and share {% data variables.product.prodname_vscode %} settings between {% data variables.product.prodname_github_codespaces %} and other instances of {% data variables.product.prodname_vscode %}.
- [Settings Sync](#settings-sync) - You can share your {% data variables.product.prodname_vscode %} settings between the desktop application and the {% data variables.product.prodname_vscode_shortname %} web client.
- [Dotfiles](#dotfiles) You can use a `dotfiles` repository to specify scripts, shell preferences, and other configurations.
{% data variables.product.prodname_github_codespaces %} personalization applies to any codespace you create.
@@ -32,13 +32,13 @@ Project maintainers can also define a default configuration that applies to ever
## Settings Sync
Settings Sync allows you to share configurations such as settings, keyboard shortcuts, snippets, extensions, and UI state across machines and instances of {% data variables.product.prodname_vscode %}.
Settings Sync allows you to share configurations such as settings, keyboard shortcuts, snippets, extensions, and UI state across machines and instances of {% data variables.product.prodname_vscode_shortname %}.
To enable Settings Sync, in the bottom-left corner of the Activity Bar, select {% octicon "gear" aria-label="The gear icon" %} and click **Turn on Settings Sync…**. In the dialog box, select the settings you'd like to sync.
To enable Settings Sync, in the bottom-left corner of {% data variables.product.prodname_vscode %}'s Activity Bar, select {% octicon "gear" aria-label="The gear icon" %} and click **Turn on Settings Sync…**. In the dialog box, select the settings you'd like to sync.
![Setting Sync option in manage menu](/assets/images/help/codespaces/codespaces-manage-settings-sync.png)
For more information, see the [Settings Sync guide](https://code.visualstudio.com/docs/editor/settings-sync) in the {% data variables.product.prodname_vscode %} documentation.
For more information, see the [Settings Sync guide](https://code.visualstudio.com/docs/editor/settings-sync) in the {% data variables.product.prodname_vscode_shortname %} documentation.
## Dotfiles
@@ -65,7 +65,7 @@ Any changes to your selected dotfiles repository will apply only to each new cod
{% note %}
**Note:** Currently, {% data variables.product.prodname_github_codespaces %} does not support personalizing the _User_ settings for the {% data variables.product.prodname_vscode %} editor with your `dotfiles` repository. You can set default _Workspace_ and _Remote [Codespaces]_ settings for a specific project in the project's repository. For more information, see "[Introduction to dev containers](/github/developing-online-with-codespaces/configuring-codespaces-for-your-project#creating-a-custom-dev-container-configuration)."
**Note:** Currently, {% data variables.product.prodname_codespaces %} does not support personalizing the User-scoped settings for {% data variables.product.prodname_vscode_shortname %} with your `dotfiles` repository. You can set default Workspace and Remote [Codespaces] settings for a specific project in the project's repository. For more information, see "[Introduction to dev containers](/github/developing-online-with-codespaces/configuring-codespaces-for-your-project#creating-a-custom-dev-container-configuration)."
{% endnote %}
@@ -103,3 +103,4 @@ You can also personalize {% data variables.product.prodname_github_codespaces %}
## Further reading
* "[Creating a new repository](/github/creating-cloning-and-archiving-repositories/creating-a-new-repository)"
* "[Deep dive into GitHub Codespaces](/codespaces/getting-started/deep-dive#personalizing-your-codespace-with-extensions-or-plugins)"

View File

@@ -14,15 +14,29 @@ topics:
type: how_to
---
On the settings page, you can set your editor preference so that any newly created codespaces are opened automatically in either {% data variables.product.prodname_vscode %} for Web or the {% data variables.product.prodname_vscode %} desktop application.
On the settings page, you can set your editor preference so that when you create a codespace, or open an existing codespace, it is opened in your choice of:
* The {% data variables.product.prodname_vscode %} desktop appliction
* The {% data variables.product.prodname_vscode %} web client
* The JetBrains Gateway application
If you want to use {% data variables.product.prodname_vscode %} as your default editor for {% data variables.product.prodname_github_codespaces %}, you need to install {% data variables.product.prodname_vscode %} and the {% data variables.product.prodname_github_codespaces %} extension for {% data variables.product.prodname_vscode %}. For more information, see the [download page for {% data variables.product.prodname_vscode %}](https://code.visualstudio.com/download/) and the [{% data variables.product.prodname_github_codespaces %} extension on the {% data variables.product.prodname_vscode %} marketplace](https://marketplace.visualstudio.com/items?itemName=GitHub.codespaces).
If you want to work on a codespace in a JetBrains IDE you must install the JetBrains Gateway. For more information, see "[Using Codespaces in your JetBrains IDE](/codespaces/developing-in-codespaces/using-github-codespaces-in-your-jetbrains-ide)."
## Setting your default editor
{% data reusables.user-settings.access_settings %}
{% data reusables.user-settings.codespaces-tab %}
1. Under "Editor preference", select the option you want.
![Setting your editor](/assets/images/help/codespaces/select-default-editor.png)
If you choose **{% data variables.product.prodname_vscode %}**, {% data variables.product.prodname_github_codespaces %} will automatically open in the desktop application when you next create a codespace. You may need to allow access to both your browser and {% data variables.product.prodname_vscode %} for it to open successfully.
![Setting your editor](/assets/images/help/codespaces/launch-default-editor.png)
* If you choose **{% data variables.product.prodname_vscode %}**, {% data variables.product.prodname_github_codespaces %} will automatically open in the desktop application when you next create or open a codespace.
You may need to allow access to both your browser and {% data variables.product.prodname_vscode %} for it to open successfully.<br><br>
* If you choose **JetBrains Gateway**, the Gateway application will automatically open when you next create or open a codespace.
The first time you open a codespace this way you must give permission to open the application.
The Gateway application will open and the codespace will then be automatically selected. You can then choose a JetBrains IDE, if you have not previously done so, and click **Connect** to open the codespace in the JetBrains client. For more information, see "[Using Codespaces in your JetBrains IDE](/codespaces/developing-in-codespaces/using-github-codespaces-in-your-jetbrains-ide)."

View File

@@ -13,7 +13,7 @@ redirect_from:
- /codespaces/customizing-your-codespace/setting-your-timeout-period-for-codespaces
---
A codespace will stop running after a period of inactivity. You can specify the length of this timeout period. The updated setting will apply to any newly created codespace.
A codespace will stop running after a period of inactivity. By default this period is 30 minutes, but you can specify a longer or shorter period in your personal settings. The updated setting will apply to any new codespaces you create, or to existing codespaces the next time you start them.
Some organizations may have a maximum idle timeout policy. If an organization policy sets a maximum timeout which is less than the default timeout you have set, the organization's timeout will be used instead of your setting, and you will be notified of this after the codespace is created. For more information, see "[Restricting the idle timeout period](/codespaces/managing-codespaces-for-your-organization/restricting-the-idle-timeout-period)."

View File

@@ -41,7 +41,7 @@ When a codespace times out, your data is preserved from the last time your chang
## Rebuilding a codespace
You can rebuild your codespace to restore a clean state as if you had created a new codespace. For most uses, you can create a new codespace as an alternative to rebuilding a codespace. You are most likely to rebuild a codespace to implement changes to your dev container. When you rebuild a codespace, any Docker containers, images, volumes, and caches are cleaned, then the codespace is rebuilt.
You can rebuild your codespace to restore a clean state as if you had created a new codespace. For most uses, you can create a new codespace as an alternative to rebuilding a codespace. You are most likely to rebuild a codespace to implement changes to your dev container configuration. When you rebuild a codespace, any Docker containers, images, volumes, and caches are cleaned, then the codespace is rebuilt.
If you need any of this data to persist over a rebuild, you can create, at the desired location in the container, a symbolic link (symlink) to the persistent directory. For example, in your `.devcontainer` directory, you can create a `config` directory that will be preserved across a rebuild. You can then symlink the `config` directory and its contents as a `postCreateCommand` in your `devcontainer.json` file.

View File

@@ -18,7 +18,15 @@ shortTitle: Create a codespace
## About codespace creation
You can create a codespace on {% data variables.product.prodname_dotcom_the_website %}, in {% data variables.product.prodname_vscode %}, or by using {% data variables.product.prodname_cli %}. {% data reusables.codespaces.codespaces-are-personal %}
You can create a codespace on {% data variables.product.prodname_dotcom_the_website %}, in {% data variables.product.prodname_vscode %}, or by using {% data variables.product.prodname_cli %}. Use the tabs in this article to display instructions for each of these ways of creating a codespace.
{% note %}
**Note**: If you use a JetBrains IDE, you can use {% data variables.product.prodname_cli %} to create a codespace. You can then use the JetBrains Gateway application to open the codespace in a JetBrains IDE. For more information, see "[Using Codespaces in your JetBrains IDE](/codespaces/developing-in-codespaces/using-github-codespaces-in-your-jetbrains-ide)."
{% endnote %}
{% data reusables.codespaces.codespaces-are-personal %}
Codespaces are associated with a specific branch of a repository and the repository cannot be empty. You can create more than one codespace per repository or even per branch.

View File

@@ -16,6 +16,8 @@ topics:
shortTitle: Delete a codespace
---
You can delete a codespace in a variety of ways: in the terminal by using {% data variables.product.prodname_cli %}, in {% data variables.product.prodname_vscode %}, or in your web browser. Use the tabs in this article to display instructions for each of these ways of deleting a codespace.
There are costs associated with storing codespaces. You should therefore delete any codespaces you no longer need. For more information, see "[About billing for GitHub Codespaces](/billing/managing-billing-for-github-codespaces/about-billing-for-github-codespaces)."
{% data reusables.codespaces.max-number-codespaces %}
@@ -58,13 +60,13 @@ For more information about this command, see [the {% data variables.product.prod
{% webui %}
You can use {% data variables.product.prodname_cli %} to delete several or all of your codespaces with a single command. For more information, click the **{% data variables.product.prodname_cli %}** tab near the top of this page.
You can use {% data variables.product.prodname_cli %} to delete several or all of your codespaces with a single command. For more information, click the "{% data variables.product.prodname_cli %}" tab near the top of this page.
{% endwebui %}
{% vscode %}
You can use {% data variables.product.prodname_cli %} to delete several or all of your codespaces with a single command. For more information, click the **{% data variables.product.prodname_cli %}** tab near the top of this page.
You can use {% data variables.product.prodname_cli %} to delete several or all of your codespaces with a single command. For more information, click the "{% data variables.product.prodname_cli %}" tab near the top of this page.
{% endvscode %}
@@ -86,7 +88,7 @@ By default you are prompted to confirm deletion of any codespaces that contain u
Delete all of the codespaces for the `octo-org/octo-repo` repository that you created more than 7 days ago.
```
gh cs delete --repo octo-org/octo-repo --days 7
gh codespace delete --repo octo-org/octo-repo --days 7
```
{% endcli %}

View File

@@ -1,6 +1,6 @@
---
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.'
intro: 'You can work in a codespace using your browser, {% data variables.product.prodname_vscode %}, a JetBrains IDE, or in a command shell.'
product: '{% data reusables.gated-features.codespaces %}'
redirect_from:
- /github/developing-online-with-github-codespaces/developing-in-a-codespace
@@ -16,41 +16,115 @@ topics:
shortTitle: Develop in a codespace
---
## About development with {% data variables.product.prodname_github_codespaces %}
You can develop code in a codespace using your choice of tool:
* A command shell, via an SSH connection initiated using {% data variables.product.prodname_cli %}.
* One of the JetBrains IDEs, via the JetBrains Gateway.
* The {% data variables.product.prodname_vscode %} desktop application.
* A browser-based version of {% data variables.product.prodname_vscode %}.
{% webui %}
The tabs in this article allow you to switch between information for each of these ways of working. You're currently on the tab for the web browser version of {% data variables.product.prodname_vscode %}.
## Working in a codespace in the browser
Using {% data variables.product.prodname_codespaces %} in the browser provides you with a fully featured development experience. You can edit code, debug, use Git commands, and run your application.
![Annotated screenshot of a codespace in the browser](/assets/images/help/codespaces/codespace-overview-annotated.png)
{% data reusables.codespaces.vscode-interface-annotation %}
{% data reusables.codespaces.use-chrome %} For more information, see "[Troubleshooting {% data variables.product.prodname_github_codespaces %} clients](/codespaces/troubleshooting/troubleshooting-github-codespaces-clients)."
{% data reusables.codespaces.developing-in-vscode %}
{% data reusables.codespaces.navigating-to-a-codespace %}
{% endwebui %}
{% vscode %}
The tabs in this article allow you to switch between information for each of these ways of working. You're currently on the tab for {% data variables.product.prodname_vscode %}.
## Working in a codespace in {% data variables.product.prodname_vscode_shortname %}
{% data variables.product.prodname_github_codespaces %} provides you with the full development experience of {% data variables.product.prodname_vscode %}. {% data reusables.codespaces.use-visual-studio-features %}
{% data reusables.codespaces.links-to-get-started %}
![Annotated screenshot of a codespace in VS Code](/assets/images/help/codespaces/codespace-annotated-vscode.png)
![Codespace overview with annotations](/assets/images/help/codespaces/codespace-overview-annotated.png)
1. Side Bar - By default, this area shows your project files in the Explorer.
2. Activity Bar - This displays the Views and provides you with a way to switch between them. You can reorder the Views by dragging and dropping them.
3. Editor - This is where you edit your files. You can use the tab for each editor to position it exactly where you need it.
4. Panels - This is where you can see output and debug information, as well as the default place for the integrated Terminal.
5. Status Bar - This area provides you with useful information about your codespace and project. For example, the branch name, configured ports, and more.
{% data reusables.codespaces.vscode-interface-annotation %}
For more information on using {% data variables.product.prodname_vscode_shortname %}, see the [User Interface guide](https://code.visualstudio.com/docs/getstarted/userinterface) in the {% data variables.product.prodname_vscode_shortname %} documentation.
{% data reusables.codespaces.connect-to-codespace-from-vscode %}
{% data reusables.codespaces.connect-to-codespace-from-vscode %}
{% data reusables.codespaces.use-chrome %} For more information, see "[Troubleshooting {% data variables.product.prodname_github_codespaces %} clients](/codespaces/troubleshooting/troubleshooting-codespaces-clients)."
For troubleshooting information, see "[Troubleshooting Codespaces clients](/codespaces/troubleshooting/troubleshooting-github-codespaces-clients)."
{% data reusables.codespaces.developing-in-vscode %}
{% data reusables.codespaces.navigating-to-a-codespace %}
{% endvscode %}
{% jetbrains %}
The tabs in this article allow you to switch between information for each of these ways of working. You're currently on the tab for JetBrains IDEs.
## Working in a codespace in a JetBrains IDE
To use {% data variables.product.prodname_github_codespaces %} with a JetBrains IDE you must have already installed JetBrains Gateway. For information about installing JetBrains Gateway, see [the jetbrains.com website](https://www.jetbrains.com/remote-development/gateway/).
You can work in a codespace using your choice of JetBrains IDE. After creating a codespace, you can use the JetBrains Gateway application to open the codespace in your preferred IDE.
You can edit code, debug, and use Git commands while developing in a codespace with your JetBrains IDE. For more information about the various JetBrains IDEs, see the [JetBrains documentation](https://www.jetbrains.com/help/).
### IntelliJ IDEA user interface
Within the {% data variables.product.prodname_github_codespaces %} documentation we use IntelliJ IDEA as a representative JetBrains IDE.
![Annotated screenshot of a codespace in JetBrains IntelliJ IDEA](/assets/images/help/codespaces/jetbrains-gui-with-callouts.png)
1. **Navigation bar** - This displays the path to the currently selected file or directory. Use the buttons to the right of the navigation bar to perform various actions, including building, running, or debugging the project, or running Git commands to commit and push your changes.
2. **Project tool window** - This shows you the structure of your project and allows you to open files in the editor.
3. **{% data variables.product.prodname_github_codespaces %} tool window** - This is displayed by clicking the {% data variables.product.prodname_github_codespaces %} plugin in the bar to the left of the tool window. It displays information about your codespace, including its display name and machine type.
4. **Editor** - This is where you edit your files. You can right-click the tab for a file to access options such as moving the tab to a new window.
5. **Terminal** - This is displayed by clicking **Terminal** in the tool window bar at the bottom of the main window (just above the status bar). The integrated terminal allows you to perform command-line tasks without having to switch to a dedicated terminal application.
6. **Status bar** - Position the mouse pointer over the icon at the left of the status bar to see a list of tools. Click the icon to hide or show the tool window bars. The right side of the status bar shows information about the project, including the current Git branch.
For more information about the IntelliJ IDEA user interface, see the [JetBrains documentation for IntelliJ IDEA](https://www.jetbrains.com/help/idea/guided-tour-around-the-user-interface.html).
### Customizing the codespaces for a repository
You can customize the codespaces that are created for a repository by creating or updating the dev container configuration for the repository. You can do this from within a codespace. After you change a dev container configuration, you can apply the changes to the current codespace by rebuilding the Docker container for the codespace. For more information, see "[Introduction to dev containers](/codespaces/setting-up-your-project-for-codespaces/introduction-to-dev-containers)."
### Personalizing your codespace
{% data reusables.codespaces.about-personalization %} For more information, see "[Personalizing {% data variables.product.prodname_github_codespaces %} for your account](/codespaces/customizing-your-codespace/personalizing-github-codespaces-for-your-account)."
{% data reusables.codespaces.apply-devcontainer-changes %} For more information, see "[Introduction to dev containers](/codespaces/setting-up-your-project-for-codespaces/introduction-to-dev-containers)."
### Running your app from a codespace
{% data reusables.codespaces.about-port-forwarding %} For more information, see "[Forwarding ports in your codespace](/github/developing-online-with-codespaces/forwarding-ports-in-your-codespace)."
You can use a [dotfiles](https://dotfiles.github.io/tutorials/) repository to personalize aspects of the codespace environment for any codespace that you create. For more information, see "[Personalizing {% data variables.product.prodname_github_codespaces %} for your account](/codespaces/customizing-your-codespace/personalizing-github-codespaces-for-your-account#dotfiles)."
### Committing your changes
{% data reusables.codespaces.committing-link-to-procedure %}
Once you've made changes to your codespace, either new code or configuration changes, you'll want to commit your changes. Committing changes to your repository ensures that anyone else who creates a codespace from this repository has the same configuration. This also means that any customization you do, to modify the configuration of codespaces created for a repository, will be available to everybody who uses the repository.
### Using the {% data variables.product.prodname_vscode_command_palette %}
For information, see "[Using source control in your codespace](/codespaces/developing-in-codespaces/using-source-control-in-your-codespace#committing-your-changes)."
The {% data variables.product.prodname_vscode_command_palette %} allows you to access and manage many features for {% data variables.product.prodname_github_codespaces %} and {% data variables.product.prodname_vscode_shortname %}. For more information, see "[Using the {% data variables.product.prodname_vscode_command_palette_shortname %} in {% data variables.product.prodname_github_codespaces %}](/codespaces/codespaces-reference/using-the-vs-code-command-palette-in-codespaces)."
## Further reading
* "[Using {% data variables.product.prodname_github_codespaces %} in your JetBrains IDE](/codespaces/developing-in-codespaces/using-github-codespaces-in-your-jetbrains-ide)"
* "[Using the {% data variables.product.prodname_github_codespaces %} plugin for JetBrains](/codespaces/codespaces-reference/using-the-github-codespaces-plugin-for-jetbrains)"
* "[Troubleshooting {% data variables.product.prodname_github_codespaces %} clients](/codespaces/troubleshooting/troubleshooting-github-codespaces-clients)"
{% endjetbrains %}
{% cli %}
The tabs in this article allow you to switch between information for each of these ways of working. You're currently on the tab for {% data variables.product.prodname_cli %}.
## Working in a codespace in a command shell
{% data reusables.cli.cli-learn-more %}
You can use {% data variables.product.prodname_cli %} to create a new codespace, or start an existing codespace, and then SSH to it. Once connected, you can work on the command line using your preferred command-line tools.
After installing {% data variables.product.prodname_cli %} and authenticating with your {% data variables.product.prodname_dotcom %} account you can use the command `gh codespace [<SUBCOMMAND>...] --help` to browse the help information. Alternatively, you can view the same reference information at [https://cli.github.com/manual/gh_codespace](https://cli.github.com/manual/gh_codespace).
For more information, see "[Using {% data variables.product.prodname_github_codespaces %} with GitHub CLI](/codespaces/developing-in-codespaces/using-github-codespaces-with-github-cli)."
{% endcli %}

View File

@@ -19,24 +19,9 @@ shortTitle: Forward ports
Port forwarding gives you access to TCP ports running within your codespace. For example, if you're running a web application on a particular port in your codespace, you can forward that port. This allows you to access the application from the browser on your local machine for testing and debugging.
When an application running inside a codespace prints output to the terminal that contains a localhost URL, such as `http://localhost:PORT` or `http://127.0.0.1:PORT`, the port is automatically forwarded. If you're using {% data variables.product.prodname_github_codespaces %} in the browser or in {% data variables.product.prodname_vscode %}, the URL string in the terminal is converted into a link that you can click to view the web page on your local machine. By default, {% data variables.product.prodname_github_codespaces %} forwards ports using HTTP.
![Automatic port forwarding](/assets/images/help/codespaces/automatic-port-forwarding.png)
You can also forward a port manually, label forwarded ports, share forwarded ports with members of your organization, share forwarded ports publicly, and add forwarded ports to the codespace configuration.
{% note %}
**Note**: {% data reusables.codespaces.restrict-port-visibility %}
{% endnote %}
## Forwarding a port
You can manually forward a port that wasn't forwarded automatically.
{% webui %}
{% data reusables.codespaces.port-forwarding-intro-non-jetbrains %}
{% data reusables.codespaces.navigate-to-ports-tab %}
1. Under the list of ports, click **Add port**.
@@ -55,6 +40,18 @@ By default, {% data variables.product.prodname_github_codespaces %} forwards por
![Option to change port protocol](/assets/images/help/codespaces/update-port-protocol.png)
1. Select the protocol needed for this port. The protocol that you select will be remembered for this port for the lifetime of the codespace.
{% data reusables.codespaces.port-forwarding-sharing-non-jetbrains %}
{% data reusables.codespaces.navigate-to-ports-tab %}
1. Right click the port that you want to share, select the "Port Visibility" menu, then click **Private to Organization** or **Public**.
![Option to select port visibility in right-click menu](/assets/images/help/codespaces/make-public-option.png)
1. To the right of the local address for the port, click the copy icon.
![Copy icon for port URL](/assets/images/help/codespaces/copy-icon-port-url.png)
1. Send the copied URL to the person you want to share the port with.
{% data reusables.codespaces.port-forwarding-labeling-non-jetbrains %}
{% data reusables.codespaces.port-forwarding-adding-non-jetbrains %}
{% endwebui %}
{% vscode %}
@@ -68,6 +65,18 @@ By default, {% data variables.product.prodname_github_codespaces %} forwards por
![Text box to type port button](/assets/images/help/codespaces/port-number-text-box.png)
{% data reusables.codespaces.port-forwarding-sharing-non-jetbrains %}
{% data reusables.codespaces.navigate-to-ports-tab %}
1. Right click the port that you want to share, select the "Port Visibility" menu, then click **Private to Organization** or **Public**.
![Option to make port public in right-click menu](/assets/images/help/codespaces/make-public-option.png)
1. To the right of the local address for the port, click the copy icon.
![Copy icon for port URL](/assets/images/help/codespaces/copy-icon-port-url.png)
1. Send the copied URL to the person you want to share the port with.
{% data reusables.codespaces.port-forwarding-labeling-non-jetbrains %}
{% data reusables.codespaces.port-forwarding-adding-non-jetbrains %}
{% endvscode %}
@@ -85,47 +94,7 @@ For more information about this command, see [the {% data variables.product.prod
To see details of forwarded ports enter `gh codespace ports` and then choose a codespace.
{% endcli %}
## Sharing a port
{% note %}
**Note:** You can only make a port private to an organization if your organization uses {% data variables.product.prodname_team %} or {% data variables.product.prodname_ghe_cloud %}.
{% endnote %}
If you want to share a forwarded port with others, you can either make the port private to your organization or make the port public. After you make a port private to your organization, anyone in the organization with the port's URL can view the running application. After you make a port public, anyone who knows the URL and port number can view the running application without needing to authenticate.
{% note %}
**Note:** Your choice of port visibility options may be limited by a policy configured for your organization. For more information, see "[Restricting the visibility of forwarded ports](/codespaces/managing-codespaces-for-your-organization/restricting-the-visibility-of-forwarded-ports)."
{% endnote %}
{% webui %}
{% data reusables.codespaces.navigate-to-ports-tab %}
1. Right click the port that you want to share, select the "Port Visibility" menu, then click **Private to Organization** or **Public**.
![Option to select port visibility in right-click menu](/assets/images/help/codespaces/make-public-option.png)
1. To the right of the local address for the port, click the copy icon.
![Copy icon for port URL](/assets/images/help/codespaces/copy-icon-port-url.png)
1. Send the copied URL to the person you want to share the port with.
{% endwebui %}
{% vscode %}
{% data reusables.codespaces.navigate-to-ports-tab %}
1. Right click the port that you want to share, select the "Port Visibility" menu, then click **Private to Organization** or **Public**.
![Option to make port public in right-click menu](/assets/images/help/codespaces/make-public-option.png)
1. To the right of the local address for the port, click the copy icon.
![Copy icon for port URL](/assets/images/help/codespaces/copy-icon-port-url.png)
1. Send the copied URL to the person you want to share the port with.
{% endvscode %}
{% cli %}
{% data reusables.codespaces.port-forwarding-sharing-non-jetbrains %}
To change the visibility of a forwarded port, use the `gh codespace ports visibility` subcommand. {% data reusables.codespaces.port-visibility-settings %}
@@ -143,24 +112,20 @@ gh codespace ports visibility 80:private 3000:public 3306:org
For more information about this command, see [the {% data variables.product.prodname_cli %} manual](https://cli.github.com/manual/gh_codespace_ports_visibility).
{% data reusables.codespaces.port-forwarding-labeling-non-jetbrains %}
You can see the port labels when you list the forwarded ports for a codespace. To do this, use the `gh codespace ports` command and then select a codespace.
{% data reusables.codespaces.port-forwarding-adding-non-jetbrains %}
{% endcli %}
## Labeling a port
{% jetbrains %}
You can label a port to make the port more easily identifiable in a list.
## Forwarding a port
{% data reusables.codespaces.navigate-to-ports-tab %}
1. Hover over the port you want to label, then click the label icon.
![Label icon for port](/assets/images/help/codespaces/label-icon.png)
{% data reusables.codespaces.type-port-label %}
For information on how to forward a port in a codespace to a port on your local machine, see the "Port forwarding" section of the "[Security model](https://www.jetbrains.com/help/idea/security-model.html#port_forwarding)" article in the JetBrains documentation.
## Adding a port to the codespace configuration
Alternatively, you can use {% data variables.product.prodname_cli %} to forward a port. For more information, click the "{% data variables.product.prodname_cli %}" tab at the top of this page.
You can add a forwarded port to the {% data variables.product.prodname_github_codespaces %} configuration for the repository, so the port will automatically be forwarded for all codespaces created from the repository. After you update the configuration, any previously created codespaces must be rebuilt for the change to apply. For more information, see "[Introduction to dev containers](/codespaces/setting-up-your-project-for-codespaces/introduction-to-dev-containers#applying-configuration-changes-to-a-codespace)."
You can manually configure forwarded ports in a `.devcontainer.json` file using the `forwardPorts` property, or you can use the "Ports" panel in your codespace.
{% data reusables.codespaces.navigate-to-ports-tab %}
1. Right click the port you want to add to the codespace configuration, then click **Set Label and Update devcontainer.json**.
![Option to set label and add port to devcontainer.json in the right-click menu](/assets/images/help/codespaces/update-devcontainer-to-add-port-option.png)
{% data reusables.codespaces.type-port-label %}
{% endjetbrains %}

View File

@@ -106,7 +106,7 @@ Some software, such as TensorFlow, requires you to install NVIDIA CUDA to use yo
The default container image that's used by {% data variables.product.prodname_github_codespaces %} includes JupyterLab, the web-based Jupyter IDE. You can use {% data variables.product.prodname_cli %} to open your codespace in JupyterLab without having to install anything else on your codespace.
1. In the terminal, enter the {% data variables.product.prodname_cli %} command `gh cs jupyter`.
1. In the terminal, enter the {% data variables.product.prodname_cli %} command `gh codespace jupyter`.
1. Choose the codespace you want to open.
![Screenshot of opening a codespace from the terminal](/assets/images/help/codespaces/open-codespace-in-jupyter.png)

View File

@@ -22,6 +22,7 @@ children:
- /connecting-to-a-private-network
- /getting-started-with-github-codespaces-for-machine-learning
- /using-github-codespaces-in-visual-studio-code
- /using-github-codespaces-in-your-jetbrains-ide
- /using-github-codespaces-with-github-cli
---

View File

@@ -13,7 +13,7 @@ topics:
shortTitle: Open an existing codespace
---
You can reopen any of your active or stopped codespaces on {% data variables.product.prodname_dotcom_the_website %}, in {% data variables.product.prodname_vscode %}, or by using {% data variables.product.prodname_cli %}. You can't reopen a codespace that has been deleted. For more information, see "[{% data variables.product.prodname_codespaces %} lifecycle](/codespaces/developing-in-codespaces/codespaces-lifecycle)."
You can reopen any of your active or stopped codespaces on {% data variables.product.prodname_dotcom_the_website %}, in a JetBrains IDE, in {% data variables.product.prodname_vscode %}, or by using {% data variables.product.prodname_cli %}. You can't reopen a codespace that has been deleted. For more information, see "[{% data variables.product.prodname_codespaces %} lifecycle](/codespaces/developing-in-codespaces/codespaces-lifecycle)."
## Opening an existing codespace
@@ -72,3 +72,9 @@ You can also access the commands listed above by navigating to the Remote Explor
For more information, see [`gh codespace code`](https://cli.github.com/manual/gh_codespace_code) in the {% data variables.product.prodname_cli %} manual.
{% endcli %}
{% jetbrains %}
{% data reusables.codespaces.opening-codespace-in-jetbrains %}
{% endjetbrains %}

View File

@@ -21,19 +21,18 @@ Regardless of where you created or access your codespaces, you can view and mana
## Stopping a codespace
{% webui %}
{% webui %}
{% data reusables.codespaces.navigate-to-codespaces-page %}
1. To the right of the codespace you want to stop, click the elipsis (**...**).
1. Click **Stop codespace**.
![Screenshot of option to stop a codespace](/assets/images/help/codespaces/stop-codespace-webui.png)
{% endwebui %}
{% endwebui %}
{% cli %}
{% cli %}
{% data reusables.cli.cli-learn-more %}
{% data reusables.cli.cli-learn-more %}
To stop a codespace use the `gh codespace stop` subcommand and then choose the codespace you want to stop from the list that's displayed.
@@ -41,29 +40,36 @@ Regardless of where you created or access your codespaces, you can view and mana
gh codespace stop
```
{% endcli %}
{% endcli %}
{% vscode %}
{% vscode %}
{% data reusables.vs-code.open-command-palette %}
1. Type `stop` and select **Codespaces: Stop Codespace** from the list of options.
1. In the list of codespaces, select the codespace you want to stop.
{% endvscode %}
{% endvscode %}
{% jetbrains %}
{% data reusables.codespaces.jetbrains-open-codespace-plugin %}
1. In the {% data variables.product.prodname_github_codespaces %} tool window, click the stop icon.
![Screenshot of the log button](/assets/images/help/codespaces/jetbrains-plugin-icon-stop.png)
{% endjetbrains %}
## Restarting a codespace
{% webui %}
{% webui %}
{% data reusables.codespaces.navigate-to-codespaces-page %}
1. Click the name of the codespace you want to restart.
![Screenshot of stopped codespaces](/assets/images/help/codespaces/restart-codespace-webui.png)
{% endwebui %}
{% endwebui %}
{% cli %}
{% cli %}
When you restart a codespace you can choose to open it in {% data variables.product.prodname_vscode %} or in your browser.
@@ -79,16 +85,22 @@ When you restart a codespace you can choose to open it in {% data variables.prod
gh codespace open --web
```
{% endcli %}
{% endcli %}
{% vscode %}
{% vscode %}
{% data reusables.vs-code.open-command-palette %}
1. Type `connect` and select **Codespaces: Connect to Codespace** from the list of options.
1. In the list of codespaces, select the codespace you want to restart.
{% endvscode %}
{% endvscode %}
{% jetbrains %}
{% data reusables.codespaces.opening-codespace-in-jetbrains %}
{% endjetbrains %}
## Further reading
## Further reading
- "[Codespaces lifecycle](/codespaces/developing-in-codespaces/codespaces-lifecycle)"

View File

@@ -1,7 +1,7 @@
---
title: Using GitHub Codespaces for pull requests
shortTitle: Pull requests
intro: 'You can use {% data variables.product.prodname_github_codespaces %} in your development workflow to create pull requests, review pull requests, and address review comments.'
intro: 'You can use {% data variables.product.prodname_github_codespaces %} in your web browser, or in {% data variables.product.prodname_vscode %} to create pull requests, review pull requests, and address review comments.'
product: '{% data reusables.gated-features.codespaces %}'
versions:
fpt: '*'
@@ -27,19 +27,33 @@ redirect_from:
{% data reusables.repositories.sidebar-pr %}
1. In the list of pull requests, click the pull request you'd like to open in {% data variables.product.prodname_github_codespaces %}.
1. In the list of pull requests, click the pull request you'd like to open in {% data variables.product.prodname_codespaces %}.
1. On the right-hand side of your screen, click **{% octicon "code" aria-label="The code icon" %} Code**.
1. In the {% data variables.product.prodname_codespaces %} tab, click **Create codespace on BRANCH**.
![Option to open PR in a codespace](/assets/images/help/codespaces/open-with-codespaces-pr.png)
![Option to open PR in a codespace](/assets/images/help/codespaces/open-with-codespaces-pr.png)
A codespace is created for the pull request branch and is opened in your default editor for {% data variables.product.prodname_github_codespaces %}.
## Reviewing a pull request in {% data variables.product.prodname_codespaces %}
{% data reusables.codespaces.review-pr %}
1. With your default editor set to either {% data variables.product.prodname_vscode %} or {% data variables.product.prodname_vscode %} for Web, open the pull request in a codespace, as described in "[Opening a pull request](/codespaces/developing-in-codespaces/using-codespaces-for-pull-requests#opening-a-pull-request-in-codespaces)" above.
2. In the Activity Bar, click the **GitHub Pull Request** view. This view only appears when you open a pull request in a codespace.
![Option to open PR in a codespace](/assets/images/help/codespaces/github-pr-view.png)
3. To review a specific file, click the **Open File** icon in the Side Bar.
![Option to open PR in a codespace](/assets/images/help/codespaces/changes-in-files.png)
4. To add review comments, click the **+** icon next to the line number. Type your review comment and then click **Start Review**.
![Option to open PR in a codespace](/assets/images/help/codespaces/start-review.png)
5. When you are finished adding review comments, from the Side Bar you can choose to either submit the comments, approve the changes, or request changes.
![Option to open PR in a codespace](/assets/images/help/codespaces/submit-review.png)
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.
Once you have received feedback on a pull request, you can [open it in a codespace](#opening-a-pull-request-in-codespaces) in your web browser, or in {% data variables.product.prodname_vscode_shortname %}, 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,5 +1,6 @@
---
title: Using GitHub Codespaces in Visual Studio Code
shortTitle: 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:
@@ -15,9 +16,7 @@ topics:
- Codespaces
- Visual Studio Code
- Developer
shortTitle: Visual Studio Code
---
## About {% data variables.product.prodname_github_codespaces %} in {% data variables.product.prodname_vscode %}
@@ -37,9 +36,9 @@ Use the {% data variables.product.prodname_vscode_marketplace %} to install the
{% mac %}
{% data reusables.codespaces.click-remote-explorer-icon-vscode %}
1. Click **Sign in to view {% data variables.product.prodname_dotcom %}...**.
1. Click **Sign in to {% data variables.product.prodname_dotcom %}...**.
![Signing in to view {% data variables.product.prodname_github_codespaces %}](/assets/images/help/codespaces/sign-in-to-view-codespaces-vscode-mac.png)
![Signing in to {% data variables.product.prodname_github_codespaces %}](/assets/images/help/codespaces/sign-in-to-view-codespaces-vscode-mac.png)
2. To authorize {% data variables.product.prodname_vscode_shortname %} to access your account on {% data variables.product.product_name %}, click **Allow**.
3. Sign in to {% data variables.product.product_name %} to approve the extension.
@@ -53,7 +52,7 @@ Use the {% data variables.product.prodname_vscode_marketplace %} to install the
![The {% data variables.product.prodname_github_codespaces %} header](/assets/images/help/codespaces/codespaces-header-vscode.png)
1. Click **Sign in to view {% data variables.product.prodname_codespaces %}...**.
1. Click **Sign in to view {% data variables.product.prodname_codespaces %}**.
![Signing in to view {% data variables.product.prodname_github_codespaces %}](/assets/images/help/codespaces/sign-in-to-view-codespaces-vscode.png)
@@ -100,4 +99,10 @@ You can use the [Insiders Build of {% data variables.product.prodname_vscode_sho
2. From the list, select "Switch to Insiders Version".
![Clicking on "Insiders Build" in {% data variables.product.prodname_github_codespaces %}](/assets/images/help/codespaces/codespaces-insiders-vscode.png)
3. Once selected, {% data variables.product.prodname_github_codespaces %} will continue to open in Insiders Version.
## Further reading
- "[Using the {% data variables.product.prodname_vscode_command_palette %} in {% data variables.product.prodname_github_codespaces %}](/codespaces/codespaces-reference/using-the-vs-code-command-palette-in-codespaces)"
- "[Using {% data variables.product.prodname_copilot %} in {% data variables.product.prodname_github_codespaces %}](/codespaces/codespaces-reference/using-github-copilot-in-github-codespaces)"

View File

@@ -0,0 +1,132 @@
---
title: Using GitHub Codespaces in your JetBrains IDE
shortTitle: JetBrains IDEs
intro: 'You can use the JetBrains Gateway to connect to your codespace and work in your favorite JetBrains IDE.'
product: '{% data reusables.gated-features.codespaces %}'
versions:
fpt: '*'
ghec: '*'
type: how_to
topics:
- Codespaces
- Developer
---
## About {% data variables.product.prodname_codespaces %} in JetBrains IDEs
If you use a JetBrains IDE to work on your code, you can take advantage of working in a codespace. You do this by using the JetBrains Gateway application.
After installing the JetBrains Gateway, you can set JetBrains as your default editor and then whenever you open a codespace from {% data variables.product.prodname_dotcom_the_website %} the JetBrains Gateway will launch to allow you to choose your JetBrains IDE and connect to the codespace.
{% note %}
**Note**: Only existing codespaces are available in the JetBrains Gateway. You can create codespaces in {% data variables.product.prodname_dotcom_the_website %}, or by using {% data variables.product.prodname_cli %}. For more information, see "[Creating a codespace](/codespaces/developing-in-codespaces/creating-a-codespace)."
{% endnote %}
### The JetBrains remote development connection process
The basic process behind using a codespace in your JetBrains IDE is as follows.
* In the JetBrains Gateway application you select one of your active or stopped codespaces.
* You then choose which JetBrains IDE you want to use.
* The selected JetBrains IDE is then downloaded to the remote virtual machine that hosts your codespace and source code.
* The JetBrains thin client application is then downloaded to your local machine and started.
* The client application connects to the full backend IDE.
* You can work on your code in the client application in just the same way you would in a local environment.
## Prerequisites
To work in a codespace in a JetBrains IDE you need:
* A valid JetBrains license
* The JetBrains Gateway application
* {% data variables.product.prodname_cli %} version 2.2.0 or later
### JetBrains Gateway
An easy way to install and update the JetBrains Gateway is from the JetBrains Toolbox application.
1. Download and install the [JetBrains Toolbox](https://www.jetbrains.com/toolbox-app).
1. Open the JetBrains Toolbox.
1. Find **Gateway** in the list of available tools and click **Install**.
![Screenshot of the JetBrains Toolbox](/assets/images/help/codespaces/jetbrains-toolbox.png)
### {% data variables.product.prodname_cli %}
The {% data variables.product.prodname_github_codespaces %} plugin that's preinstalled in the JetBrains Gateway requires that you have installed and configured {% data variables.product.prodname_cli %} version 2.2.0 or later before opening a codespace from the JetBrains Gateway.
Use this command to check your version of {% data variables.product.prodname_cli %}:
```shell{:copy}
gh --version
```
For more information, see "[About GitHub CLI](/github-cli/github-cli/about-github-cli)."
## Authenticating with {% data variables.product.prodname_cli %}
If you have not used {% data variables.product.prodname_cli %} before, you must authenticate with {% data variables.product.prodname_dotcom_the_website %}.
1. In a terminal window:
```shell{:copy}
gh auth login
```
1. Follow the prompts to complete the authentication process, choosing these options:
* What account do you want to log into? `{% data variables.product.prodname_dotcom_the_website %}`
* What is your preferred protocol for Git operations? `HTTPS`
* Authenticate Git with your GitHub credentials? `yes`
* How would you like to authenticate GitHub CLI? `Login with a web browser`
1. Copy the one-time code and press <kbd>Enter</kbd>.
1. Paste the copied code and click **Continue**.
1. If you belong to organizations, the "Single sign-on to your organizations" page is displayed. Click **Authorize** beside the organizations you want to authorize the JetBrains Gateway to access, then click **Continue**.
1. On the "Authorize {% data variables.product.prodname_github_codespaces %} for JetBrains" page, click **Authorize {% data variables.product.prodname_dotcom %}**.
## Setting up the JetBrains Gateway
The first time you use JetBrains Gateway for {% data variables.product.prodname_github_codespaces %}, you must supply the path to the installed {% data variables.product.prodname_cli %} executable. You must also allow the JetBrains Gateway to access {% data variables.product.prodname_dotcom_the_website %} using your {% data variables.product.prodname_dotcom %} account.
1. Find the path to the {% data variables.product.prodname_cli %} executable, for example by typing `which gh` (Linux/Mac) or `where.exe gh` (Windows) in a terminal window.
1. Open the JetBrains Gateway application.
1. Click **Connect to {% data variables.product.prodname_codespaces %}**.
![Screenshot of the JetBrains Gateway initial view](/assets/images/help/codespaces/jetbrains-gateway-connect.png)
1. In the "Welcome to JetBrains Gateway" dialog box, click the **{% data variables.product.prodname_dotcom %} {% data variables.product.prodname_codespaces %} settings** link.
![Screenshot of the prompt for the CLI path](/assets/images/help/codespaces/jetbrains-gateway-cli-setup.png)
1. Type the path to the {% data variables.product.prodname_cli %} executable, then click **OK**.
![Screenshot of the CLI path input dialog box](/assets/images/help/codespaces/jetbrains-gateway-cli-path.png)
1. Click **Connect to {% data variables.product.prodname_codespaces %}** again.
1. Click **Sign in with {% data variables.product.prodname_dotcom %}**.
![Screenshot of the sign in button](/assets/images/help/codespaces/jetbrains-gateway-sign-in.png)
1. Click the icon beside the one-time code to copy it, then click the login link.
![Screenshot of the one-time login code](/assets/images/help/codespaces/jetbrains-gateway-login-code.png)
1. If you are not currently signed in to {% data variables.product.prodname_dotcom %}, the sign-in page is displayed. Enter your details and click **Sign in**.
1. Verify your authentication, for example by entering a two-factor authentication code.
1. On the "Device activation" page, paste the copied code and click **Continue**.
1. If you belong to organizations, the "Single sign-on to your organizations" page is displayed. Click **Authorize** beside the organizations you want to authorize the JetBrains Gateway to access, then click **Continue**.
1. On the "Authorize {% data variables.product.prodname_github_codespaces %} for JetBrains" page, click **Authorize {% data variables.product.prodname_dotcom %}**.
1. Return to the JetBrains Gateway application and open a codespace from the list of your currently active or stopped codespaces, see step 3 of the following procedure.
## Opening a codespace in your JetBrains IDE
{% data reusables.codespaces.opening-codespace-in-jetbrains %}
The first time you connect to a codespace, the backend IDE will be downloaded to the remote machine. This may take a few minutes. The next time you connect to the same codespace this step won't be necessary, making the connection process quicker. The backend IDE is then started. Again, this step will not be required in future if you are reconnecting to a backend IDE that you have left running. The client application is then launched.
## Further reading
- "[Developing in a codespace](/codespaces/developing-in-codespaces/developing-in-a-codespace)"
- "[Using the {% data variables.product.prodname_github_codespaces %} plugin for JetBrains](/codespaces/codespaces-reference/using-the-github-codespaces-plugin-for-jetbrains)"
- "[Using {% data variables.product.prodname_copilot %} in {% data variables.product.prodname_github_codespaces %}](/codespaces/codespaces-reference/using-github-copilot-in-github-codespaces)"

View File

@@ -6,6 +6,7 @@ product: '{% data reusables.gated-features.codespaces %}'
miniTocMaxHeadingLevel: 3
versions:
fpt: '*'
ghec: '*'
type: how_to
topics:
- Codespaces
@@ -116,7 +117,7 @@ If you don't have any SSH keys, follow the instructions in "[Generating a new SS
gh codespace code -c CODESPACE-NAME
```
For more information, see "[Using {% data variables.product.prodname_github_codespaces %} in {% data variables.product.prodname_vscode %}](/codespaces/developing-in-codespaces/using-codespaces-in-visual-studio-code)."
For more information, see "[Using {% data variables.product.prodname_github_codespaces %} in {% data variables.product.prodname_vscode %}](/codespaces/developing-in-codespaces/using-github-codespaces-in-visual-studio-code)."
### Open a codespace in JupyterLab

View File

@@ -13,13 +13,22 @@ topics:
shortTitle: Source control
---
## About source control in {% data variables.product.prodname_github_codespaces %}
You can perform all the Git actions you need directly within your codespace. For example, you can fetch changes from the remote repository, switch branches, create a new branch, commit and push changes, and create a pull request. You can use the integrated terminal within your codespace to enter Git commands, or you can click icons and menu options to complete all the most common Git tasks. This guide explains how to use the graphical user interface for source control.
Source control in {% data variables.product.prodname_github_codespaces %} uses the same workflow as {% data variables.product.prodname_vscode %}. For more information, see the {% data variables.product.prodname_vscode_shortname %} documentation "[Using Version Control in {% data variables.product.prodname_vscode_shortname %}](https://code.visualstudio.com/docs/editor/versioncontrol#_git-support)."
{% vscode %}
For more information about Git support in {% data variables.product.prodname_vscode %}, see "[Using Version Control in VS Code](https://code.visualstudio.com/docs/editor/versioncontrol#_git-support)" in the {% data variables.product.prodname_vscode %} documentation.
{% endvscode %}
{% webui %}
Source control in the {% data variables.product.prodname_vscode %} web client uses the same workflow as the {% data variables.product.prodname_vscode %} desktop application. For more information, see "[Using Version Control in VS Code](https://code.visualstudio.com/docs/editor/versioncontrol#_git-support)" in the {% data variables.product.prodname_vscode %} documentation.
{% endwebui %}
A typical workflow for updating a file using {% data variables.product.prodname_github_codespaces %} would be:
@@ -29,54 +38,81 @@ A typical workflow for updating a file using {% data variables.product.prodname_
* Commit the change.
* Raise a pull request.
{% webui %}
{% data reusables.codespaces.source-control %}
{% endwebui %}
{% vscode %}
{% data reusables.codespaces.source-control %}
{% endvscode %}
{% jetbrains %}
## Creating or switching branches
{% data reusables.codespaces.create-or-switch-branch %}
1. Click the branch name at the right side of the status bar.
{% tip %}
![Screenshot of the branch name in the status bar](/assets/images/help/codespaces/jetbrains-branch-button.png)
**Tip**: If someone has changed a file on the remote repository, in the branch you switched to, you will not see those changes until you pull the changes into your codespace.
1. In the pop-up menu, do one of the following:
* To create a new branch based on the current branch, click the name of the current branch, then choose **New Branch**.
{% endtip %}
![Screenshot of the new branch option](/assets/images/help/codespaces/jetbrains-new-branch-option.png)
## Pulling changes from the remote repository
Enter a name for the new branch and click **Create**.
You can pull changes from the remote repository into your codespace at any time.
![Screenshot of the create branch dialog box](/assets/images/help/codespaces/jetbrains-create-branch-dialog.png)
{% data reusables.codespaces.source-control-display-dark %}
1. At the top of the side bar, click the ellipsis (**...**).
![Ellipsis button for View and More Actions](/assets/images/help/codespaces/source-control-ellipsis-button.png)
1. In the drop-down menu, click **Pull**.
* To check out an existing branch, start typing the name of the branch you want to check out. Click the branch from the list, then click **Checkout**.
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 "[Introduction to dev containers](/codespaces/setting-up-your-codespace/configuring-codespaces-for-your-project#applying-configuration-changes-to-a-codespace)."
![Screenshot of the checkout option](/assets/images/help/codespaces/jetbrains-checkout-submenu.png)
## Setting your codespace to automatically fetch new changes
{% tip %}
You can set your codespace to automatically fetch details of any new commits that have been made to the remote repository. This allows you to see whether your local copy of the repository is out of date, in which case you may choose to pull in the new changes.
**Tip**: If someone has recently changed a file on the remote repository, in the branch you switched to, you may not see those changes until you pull the changes into your codespace.
If the fetch operation detects new changes on the remote repository, you'll see the number of new commits in the status bar. You can then pull the changes into your local copy.
{% endtip %}
1. Click the **Manage** button at the bottom of the Activity Bar.
![Manage button](/assets/images/help/codespaces/manage-button.png)
1. In the menu, slick **Settings**.
1. On the Settings page, search for: `autofetch`.
![Search for autofetch](/assets/images/help/codespaces/autofetch-search.png)
1. To fetch details of updates for all remotes registered for the current repository, set **Git: Autofetch** to `all`.
![Enable Git autofetch](/assets/images/help/codespaces/autofetch-all.png)
1. If you want to change the number of seconds between each automatic fetch, edit the value of **Git: Autofetch Period**.
## Committing your changes
{% data reusables.codespaces.source-control-commit-changes %}
1. At the right side of the navigation bar, click the check mark.
## Raising a pull request
![Screenshot of the commit check mark](/assets/images/help/codespaces/jetbrains-commit-button.png)
{% data reusables.codespaces.source-control-pull-request %}
1. In the Commit Changes dialog box, enter a commit message.
1. Click **Commit**.
Alternatively, click the down arrow beside **Commit** and click **Commit and Push**.
![Screenshot of the commit and push button](/assets/images/help/codespaces/jetbrains-commit-and-push.png)
## Pulling changes from the remote repository
You can pull changes from the same branch on the remote repository and apply those changes to the copy of the repository you are working on in your codespace.
1. At the right side of the navigation bar, click the downward pointing arrow.
![Screenshot of the update project downward arrow button](/assets/images/help/codespaces/jetbrains-update-project-button.png)
1. In the Update Project dialog box, choose whether you want to merge or rebase the incoming changes.
![Screenshot of the Update Project dialog box](/assets/images/help/codespaces/jetbrains-update-options.png)
1. Click **OK**.
## Pushing changes to your remote repository
You can push the changes you've made. This applies those changes to the upstream branch on the remote repository. You might want to do this if you're not yet ready to create a pull request, or if you prefer to create a pull request on {% data variables.product.prodname_dotcom %}.
You can push changes you've saved and committed. This applies those changes to the upstream branch on the remote repository. You might want to do this if you're not yet ready to create a pull request, or if you prefer to create a pull request on {% data variables.product.prodname_dotcom %}.
1. At the top of the side bar, click the ellipsis (**...**).
![Ellipsis button for View and More Actions](/assets/images/help/codespaces/source-control-ellipsis-button-nochanges.png)
1. In the drop-down menu, click **Push**.
1. At the right side of the navigation bar, click the upward pointing arrow.
![Screenshot of the push commits upward arrow](/assets/images/help/codespaces/jetbrains-push-button.png)
1. In the Push Commits dialog box, click **Push**.
{% endjetbrains %}

View File

@@ -18,16 +18,23 @@ topics:
There are a number of entry points to create a codespace.
- From your repository for new feature work.
- From an open pull request to explore work-in-progress.
- From a commit in the repository's history to investigate a bug at a specific point in time.
- From {% data variables.product.prodname_vscode %}.
- From your repository for new feature work
- From an open pull request to explore work-in-progress
- From a commit in the repository's history to investigate a bug at a specific point in time
- From {% data variables.product.prodname_vscode %}
- From {% data variables.product.prodname_cli %}
Your codespace can be ephemeral if you need to test something or you can return to the same codespace to work on long-running feature work. For more information, see "[Creating a codespace](/codespaces/developing-in-codespaces/creating-a-codespace)."
Once you've selected the option to create a new codespace, and optionally selected from the various configuration options for your codespace, some steps happen in the background before the codespace is available to you.
{% note %}
![Open with Codespaces button](/assets/images/help/codespaces/new-codespace-button.png)
**Note**: You can create more than one codespace per repository or even per branch. However, there are limits to the number of codespaces you can create, and the number of codespaces you can run at the same time. If you reach the maximum number of codespaces and try to create another, a message is displayed telling you that you must remove an existing codespace before you can create a new one.
{% endnote %}
### The codespace creation process
When you create a codespace, various steps happen in the background before the codespace is available to you.
### Step 1: VM and storage are assigned to your codespace
@@ -47,7 +54,12 @@ Since your repository is cloned onto the host VM before the container is created
### Step 3: Connecting to the codespace
When your container has been created and any other initialization has run, you'll be connected to your codespace. You can connect to it through the web or via [{% data variables.product.prodname_vscode_shortname %}](/codespaces/developing-in-codespaces/using-codespaces-in-visual-studio-code), or both, if needed.
When your container has been created and any other initialization has run, you'll be connected to your codespace. You can connect to it by using:
* Your web browser
* [Visual Studio Code](/codespaces/developing-in-codespaces/using-github-codespaces-in-visual-studio-code)
* [A JetBrains IDE](/codespaces/developing-in-codespaces/using-github-codespaces-in-your-jetbrains-ide)
* [{% data variables.product.prodname_cli %}](/codespaces/developing-in-codespaces/using-github-codespaces-with-github-cli)
### Step 4: Post-creation setup
@@ -64,20 +76,27 @@ During post-creation setup you'll still be able to use the integrated terminal a
### Saving files in your codespace
As you develop in your codespace, it will save any changes to your files every few seconds. Your codespace will keep running for 30 minutes after the last activity. After that time it will stop running but you can restart it from either from the existing browser tab or the list of existing codespaces. File changes from the editor and terminal output are counted as activity and so your codespace will not stop if terminal output is continuing.
Save changes to files in the normal way, depending on the editor you are using.
{% note %}
**Note:** Changes in a codespace in {% data variables.product.prodname_vscode_shortname %} are not saved automatically, unless you have enabled [Auto Save](https://code.visualstudio.com/docs/editor/codebasics#_save-auto-save).
{% endnote %}
If you work on codespaces in {% data variables.product.prodname_vscode %}, you can enable [Auto Save](https://code.visualstudio.com/docs/editor/codebasics#_save-auto-save) to ensure that your changes are always saved.
### Closing or stopping your codespace
To stop your codespace you can [use the {% data variables.product.prodname_vscode_command_palette %}](/codespaces/codespaces-reference/using-the-vs-code-command-palette-in-codespaces#suspending-or-stopping-a-codespace) (<kbd>Shift</kbd>+<kbd>Command</kbd>+<kbd>P</kbd> (Mac) / <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>P</kbd> (Windows/Linux)). If you exit your codespace without running the stop command (for example, closing the browser tab), or if you leave the codespace running without interaction, the codespace and its running processes will continue until a window of inactivity occurs, after which the codespace will stop. By default, the window of inactivity is 30 minutes.
Your codespace will keep running while you are using it, but will time out after a period of inactivity. File changes from the editor and terminal output are counted as activity, so your codespace will not time out if terminal output is continuing. The default inactivity timeout period is 30 minutes. You can define your personal timeout setting for codespaces you create, but this may be overruled by an organization timeout policy. For more information, see "[Setting your timeout period for Codespaces](/codespaces/customizing-your-codespace/setting-your-timeout-period-for-codespaces)."
If a codespace times out it will stop running, but you can restart it from the browser tab (if you were using the codespace in the browser), from within {% data variables.product.prodname_vscode_shortname %}, or from your list of codespaces at [https://github.com/codespaces](https://github.com/codespaces).
To stop your codespace you can
* In the browser: on your list of codespaces at [https://github.com/codespaces](https://github.com/codespaces), click the ellipsis (**...**) to the right of the codespace you want to stop and click **Stop codespace**.
* In {% data variables.product.prodname_vscode_shortname %}: open [the {% data variables.product.prodname_vscode_command_palette %}](/codespaces/codespaces-reference/using-the-vs-code-command-palette-in-codespaces#suspending-or-stopping-a-codespace) - for example, by pressing <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>Enter</kbd> (Windows/Linux) or <kbd>Shift</kbd>+<kbd>Command</kbd>+<kbd>P</kbd> (Mac) - type `Codespaces: stop` then press <kbd>Enter</kbd>.
* In the JetBrains client, click the stop button at the top of the {% data variables.product.prodname_github_codespaces %} tool window. For more information, see the "JetBrains IDEs" tab of "[Stopping and starting a codespace](/codespaces/developing-in-codespaces/stopping-and-starting-a-codespace)."
* In a terminal window: use the {% data variables.product.prodname_cli %} command `gh codespace stop`. For more information, see "[Using Codespaces with GitHub CLI](/codespaces/developing-in-codespaces/using-github-codespaces-with-github-cli#gh-commands-for-github-codespaces)."
If you exit your codespace without running the stop command (for example, by closing the browser tab), or if you leave the codespace running without interaction, the codespace and its running processes will continue for the duration of the inactivity timeout period.
When you close or stop your codespace, all uncommitted changes are preserved until you connect to the codespace again.
## Running your application
Port forwarding gives you access to TCP ports running within your codespace. For example, if you're running a web application on port 4000 within your codespace, you can automatically forward that port to make the application accessible from your browser.
@@ -94,13 +113,9 @@ Running your application when you first land in your codespace can make for a fa
## Committing and pushing your changes
Git is available by default in your codespace and so you can rely on your existing Git workflow. You can work with Git in your codespace either via the Terminal or by using [{% data variables.product.prodname_vscode_shortname %}](https://code.visualstudio.com/docs/editor/versioncontrol)'s source control UI. For more information, see "[Using source control in your codespace](/codespaces/developing-in-codespaces/using-source-control-in-your-codespace)"
Git is available by default in your codespace and so you can rely on your existing Git workflow. You can work with Git in your codespace either via the Terminal or by using the source control features of {% data variables.product.prodname_vscode_shortname %} or JetBrains. For more information, see "[Using source control in your codespace](/codespaces/developing-in-codespaces/using-source-control-in-your-codespace)"
![Running git status in Codespaces Terminal](/assets/images/help/codespaces/git-status.png)
You can create a codespace from any branch, commit, or pull request in your project, or you can switch to a new or existing branch from within your active codespace. Because {% data variables.product.prodname_github_codespaces %} is designed to be ephemeral, you can use it as an isolated environment to experiment, check a teammate's pull request, or fix merge conflicts.
You can create more than one codespace per repository or even per branch. However, there are limits to the number of codespaces you can create, and the number of codespaces you can run at the same time. If you reach the maximum number of codespaces and try to create another, a message is displayed telling you that you must remove an existing codespace before you can create a new one.
You can create a codespace from any branch, commit, or pull request in your project, or you can switch to a new or existing branch from within your active codespace. Because {% data variables.product.prodname_github_codespaces %} is designed to be ephemeral, you can use it as an isolated environment to experiment, check a teammate's pull request, or fix merge conflicts.
{% note %}
@@ -108,12 +123,28 @@ You can create more than one codespace per repository or even per branch. Howeve
{% endnote %}
## Personalizing your codespace with extensions
## Personalizing your codespace with extensions or plugins
Using {% data variables.product.prodname_vscode_shortname %} in your codespace gives you access to the {% data variables.product.prodname_vscode_marketplace %} so that you can add any extensions you need. For information on how extensions run in {% data variables.product.prodname_github_codespaces %}, see [Supporting Remote Development and GitHub Codespaces](https://code.visualstudio.com/api/advanced-topics/remote-extensions) in the {% data variables.product.prodname_vscode_shortname %} documentation.
You can add plugins and extensions within a codespace to personalize your experience in JetBrains and {% data variables.product.prodname_vscode_shortname %} respectively.
### {% data variables.product.prodname_vscode_shortname %} extensions
If you work on your codespaces in the {% data variables.product.prodname_vscode_shortname %} desktop application, or the web client, you can add any extensions you need from the {% data variables.product.prodname_vscode_marketplace %}. For information on how extensions run in {% data variables.product.prodname_github_codespaces %}, see [Supporting Remote Development and GitHub Codespaces](https://code.visualstudio.com/api/advanced-topics/remote-extensions) in the {% data variables.product.prodname_vscode_shortname %} documentation.
If you already use {% data variables.product.prodname_vscode_shortname %}, you can use [Settings Sync](https://code.visualstudio.com/docs/editor/settings-sync) to automatically sync extensions, settings, themes, and keyboard shortcuts between your local instance and any codespaces you create.
### JetBrains plugins
If you work on your codespaces in a JetBrains IDE, you can add plugins from the JetBrains Marketplace.
1. Click **JetBrains Client**, then click **Preferences**.
1. In the Preferences dialog box, click either **Plugins On Host** to install a plugin in the full JetBrains IDE that's running remotely, or **Plugins** to install a plugin on the local client, for example to change the user interface theme.
1. Click the **Marketplace** tab.
![Screenshot of the Marketplace tab for 'Plugins On Host'](/assets/images/help/codespaces/jetbrains-preferences-plugins.png)
1. Click **Install** beside the required plugin.
## Further reading
- "[Enabling {% data variables.product.prodname_github_codespaces %} for your organization](/codespaces/managing-codespaces-for-your-organization/enabling-github-codespaces-for-your-organization)"

View File

@@ -16,7 +16,7 @@ redirect_from:
## Introduction
In this guide, you'll create a codespace from a template repository and explore some of the essential features available to you within the codespace.
In this guide, you'll create a codespace from a template repository and explore some of the essential features available to you within the codespace. You'll work in the browser version of {% data variables.product.prodname_vscode %}, which is initially the default editor for {% data variables.product.prodname_github_codespaces %}. After trying out this quickstart you can use {% data variables.product.prodname_codespaces %} in other editors, and you can change the default editor. Links are provided at the end of this guide.
From this quickstart, you'll learn how to create a codespace, connect to a forwarded port to view your running application, use version control in a codespace, and personalize your setup with extensions.
@@ -31,7 +31,7 @@ For more information on exactly how {% data variables.product.prodname_github_co
Once your codespace is created, your repository will be automatically cloned into it. Now you can run the application and launch it in a browser.
1. When the terminal becomes available, enter the command `npm run dev`. This example uses a Node.js project, and this command runs the script labeled "dev" in the _package.json_ file, which starts up the web application defined in the sample repository.
1. When the terminal becomes available, enter the command `npm run dev`. This example uses a Node.js project, and this command runs the script labeled "dev" in the `package.json` file, which starts up the web application defined in the sample repository.
![npm run dev in terminal](/assets/images/help/codespaces/codespaces-npm-run-dev.png)
@@ -39,21 +39,21 @@ Once your codespace is created, your repository will be automatically cloned int
1. When your application starts, the codespace recognizes the port the application is running on and displays a prompt to let you know it has been forwarded.
![Port forwarding toast](/assets/images/help/codespaces/quickstart-port-toast.png)
![Port forwarding toast](/assets/images/help/codespaces/quickstart-port-toast.png)
1. Click **Open in Browser** to view your running application in a new tab.
## Edit the application and view changes
1. Switch back to your codespace and open the _haikus.json_ file by double-clicking it in the Explorer.
1. Switch back to your codespace and open the `haikus.json` file by double-clicking it in the Explorer.
1. Edit the `text` field of the first haiku to personalize the application with your own haiku.
1. Go back to the running application tab in your browser and refresh to see your changes.
{% octicon "light-bulb" aria-label="The lightbulb icon" %} If you've closed the tab, open the Ports panel and click the **Open in browser** icon for the running port.
{% octicon "light-bulb" aria-label="The lightbulb icon" %} If you've closed the tab, open the Ports panel and click the **Open in browser** icon for the running port.
![Port Forwarding Panel](/assets/images/help/codespaces/quickstart-forward-port.png)
![Port Forwarding Panel](/assets/images/help/codespaces/quickstart-forward-port.png)
## Committing and pushing your changes
@@ -73,42 +73,44 @@ Now that you've made a few changes, you can use the integrated terminal or the s
![Click the check mark icon](/assets/images/help/codespaces/codespaces-commit-checkmark-icon.png)
You can push the changes you've made. This applies those changes to the upstream branch on the remote repository. You might want to do this if you're not yet ready to create a pull request, or if you prefer to create a pull request on {% data variables.product.prodname_dotcom %}.
1. At the top of the side bar, click the ellipsis (**...**).
![Ellipsis button for View and More Actions](/assets/images/help/codespaces/source-control-ellipsis-button-nochanges.png)
1. In the drop-down menu, click **Push**.
1. Go back to your new repository on {% data variables.product.prodname_dotcom %} and view the _haikus.json_ file. Check that the change you made in your codespace has been successfully pushed to the repository.
1. Go back to your new repository on {% data variables.product.prodname_dotcom %} and view the `haikus.json` file. Check that the change you made in your codespace has been successfully pushed to the repository.
## Personalizing with an extension
Within a codespace, you have access to the {% data variables.product.prodname_vscode_marketplace %}. For this example, you'll install an extension that alters the theme, but you can install any extension that is useful for your workflow.
{% note %}
**Note**: If you have [Settings Sync](https://code.visualstudio.com/docs/editor/settings-sync) turned on, any changes you make to your editor setup in the current codespace, such as changing your theme or keyboard bindings, are automatically synced to any other codespaces you open and any instances of {% data variables.product.prodname_vscode %} that are signed into your {% data variables.product.prodname_dotcom %} account.
{% endnote %}
When you connect to a codespace using the browser, or the {% data variables.product.prodname_vscode %} desktop application, you can access the Visual Studio Code Marketplace directly from the editor. For this example, you'll install a {% data variables.product.prodname_vscode_shortname %} extension that alters the theme, but you can install any extension that's useful for your workflow.
1. In the left sidebar, click the Extensions icon.
1. In the search bar, enter `fairyfloss` and install the fairyfloss extension.
1. In the search bar, enter `fairyfloss`.
![Add an extension](/assets/images/help/codespaces/add-extension.png)
1. Click **Install in Codespaces**.
1. Click **Install**.
1. Select the `fairyfloss` theme by selecting it from the list.
![Select the fairyfloss theme](/assets/images/help/codespaces/fairyfloss.png)
## Next Steps
If you are using a codespace in the browser, or in the {% data variables.product.prodname_vscode %} desktop application, and you have [Settings Sync](https://code.visualstudio.com/docs/editor/settings-sync) turned on, any changes you make to your editor setup in the current codespace, such as changing your theme or keyboard bindings, are automatically synced to any instances of {% data variables.product.prodname_vscode %} that are signed into your {% data variables.product.prodname_dotcom %} account and to any other codespaces you create.
## Next steps
You've successfully created, personalized, and run your first application within a codespace but there's so much more to explore! Here are some helpful resources for taking your next steps with {% data variables.product.prodname_github_codespaces %}.
- "[Deep dive](/codespaces/getting-started/deep-dive)": This quickstart presented some of the features of {% data variables.product.prodname_github_codespaces %}. The deep dive looks at these areas from a technical standpoint.
- "[Add a dev container configuration to your repository](/codespaces/setting-up-your-project-for-codespaces/setting-up-your-project-for-codespaces)": These guides provide information on setting up your repository to use {% data variables.product.prodname_github_codespaces %} with specific languages.
- "[Introduction to dev containers](/codespaces/setting-up-your-project-for-codespaces/introduction-to-dev-containers)": This guide provides details on configuring a development container for your codespace.
* "[Deep dive](/codespaces/getting-started/deep-dive)": This quickstart presented some of the features of {% data variables.product.prodname_github_codespaces %}. The deep dive looks at these areas from a technical standpoint.
* "[Add a dev container configuration to your repository](/codespaces/setting-up-your-project-for-codespaces/setting-up-your-project-for-codespaces)": These guides provide information on setting up your repository to use {% data variables.product.prodname_github_codespaces %} with specific languages.
* "[Introduction to dev containers](/codespaces/setting-up-your-project-for-codespaces/introduction-to-dev-containers)": This guide provides details on creating a custom configuration for {% data variables.product.prodname_codespaces %} for your project.
## Further reading
- "[Enabling {% data variables.product.prodname_github_codespaces %} for your organization](/codespaces/managing-codespaces-for-your-organization/enabling-github-codespaces-for-your-organization)"
- "[Managing billing for {% data variables.product.prodname_github_codespaces %} in your organization](/codespaces/managing-codespaces-for-your-organization/managing-billing-for-github-codespaces-in-your-organization)"
* "[Enabling {% data variables.product.prodname_github_codespaces %} for your organization](/codespaces/managing-codespaces-for-your-organization/enabling-github-codespaces-for-your-organization)"
* "[Managing billing for {% data variables.product.prodname_github_codespaces %} in your organization](/codespaces/managing-codespaces-for-your-organization/managing-billing-for-github-codespaces-in-your-organization)"
* "[Using {% data variables.product.prodname_github_codespaces %} in {% data variables.product.prodname_vscode %}](/codespaces/developing-in-codespaces/using-github-codespaces-in-visual-studio-code)"
* "[Using {% data variables.product.prodname_github_codespaces %} in your JetBrains IDE](/codespaces/developing-in-codespaces/using-github-codespaces-in-your-jetbrains-ide)"
* "[Using {% data variables.product.prodname_github_codespaces %} with {% data variables.product.prodname_cli %}](/codespaces/developing-in-codespaces/using-github-codespaces-with-github-cli)"
* "[Setting your default editor for {% data variables.product.prodname_github_codespaces %}](/codespaces/customizing-your-codespace/setting-your-default-editor-for-github-codespaces)."

View File

@@ -24,8 +24,9 @@ includeGuides:
- /codespaces/developing-in-codespaces/forwarding-ports-in-your-codespace
- /codespaces/developing-in-codespaces/opening-an-existing-codespace
- /codespaces/developing-in-codespaces/stopping-and-starting-a-codespace
- /codespaces/developing-in-codespaces/using-codespaces-in-visual-studio-code
- /codespaces/developing-in-codespaces/using-codespaces-with-github-cli
- /codespaces/developing-in-codespaces/using-github-codespaces-in-visual-studio-code
- /codespaces/developing-in-codespaces/using-github-codespaces-in-your-jetbrains-ide
- /codespaces/developing-in-codespaces/using-github-codespaces-with-github-cli
- /codespaces/developing-in-codespaces/using-source-control-in-your-codespace
- /codespaces/developing-in-codespaces/using-codespaces-for-pull-requests
- /codespaces/developing-in-codespaces/changing-the-machine-type-for-your-codespace

View File

@@ -29,8 +29,9 @@ featuredLinks:
- /codespaces/getting-started/deep-dive
- /codespaces/developing-in-codespaces/creating-a-codespace
- /codespaces/developing-in-codespaces/opening-an-existing-codespace
- /codespaces/developing-in-codespaces/using-codespaces-in-visual-studio-code
- /codespaces/setting-up-your-codespace/personalizing-codespaces-for-your-account
- /codespaces/developing-in-codespaces/using-github-codespaces-in-visual-studio-code
- /codespaces/developing-in-codespaces/using-github-codespaces-in-your-jetbrains-ide
popularHeading: Set up your project
product_video: 'https://www.youtube-nocookie.com/embed/_W9B7qc9lVc'
communityRedirect:

View File

@@ -26,3 +26,4 @@ The audit log includes details such as who performed the action, what the action
## Further reading
- "[Reviewing your security logs for {% data variables.product.prodname_github_codespaces %}](/codespaces/managing-your-codespaces/reviewing-your-security-logs-for-github-codespaces)"
- "[{% data variables.product.prodname_github_codespaces %} logs](/codespaces/troubleshooting/github-codespaces-logs)"

View File

@@ -27,3 +27,4 @@ The security log includes details on what action occurred and when you performed
## Further reading
- "[Reviewing your organization's audit logs for {% data variables.product.prodname_github_codespaces %}](/codespaces/managing-codespaces-for-your-organization/reviewing-your-organizations-audit-logs-for-github-codespaces)"
- "[{% data variables.product.prodname_github_codespaces %} logs](/codespaces/troubleshooting/github-codespaces-logs)"

View File

@@ -22,7 +22,7 @@ topics:
A codespace is a development environment that's hosted in the cloud. You can customize your project for {% data variables.product.prodname_github_codespaces %} by committing [configuration files](/codespaces/customizing-your-codespace/configuring-codespaces-for-your-project) to your repository (often known as Configuration-as-Code), which creates a repeatable codespace configuration for all users of your project.
{% data variables.product.prodname_github_codespaces %} run on a variety of VM-based compute options hosted by {% data variables.product.product_location %}, which you can configure from 2 core machines up to 32 core machines. You can connect to your codespaces from the browser or locally using {% data variables.product.prodname_vscode %}.
Each codespace runs on a virtual machine hosted by {% data variables.product.product_location %}. You can choose the type of machine you want to use, depending on the resources you need. Options range from 2 core machines up to 32 core machines. You can connect to your codespaces from your browser, from {% data variables.product.prodname_vscode %}, from the JetBrains Gateway application, or by using {% data variables.product.prodname_cli %}.
![A diagram showing how {% data variables.product.prodname_github_codespaces %} works](/assets/images/help/codespaces/codespaces-diagram.png)
@@ -34,7 +34,9 @@ To customize the runtimes and tools in your codespace, you can create one or mor
If you don't add a dev container configuration, {% data variables.product.prodname_github_codespaces %} will clone your repository into an environment with the default codespace image that includes many tools, languages, and runtime environments. For more information, see "[Introduction to dev containers](/codespaces/setting-up-your-codespace/configuring-codespaces-for-your-project)".
You can also personalize aspects of your codespace environment by using a public [dotfiles](https://dotfiles.github.io/tutorials/) repository and [Settings Sync](https://code.visualstudio.com/docs/editor/settings-sync). Personalization can include shell preferences, additional tools, editor settings, and {% data variables.product.prodname_vscode_shortname %} extensions. For more information, see "[Customizing your codespace](/codespaces/customizing-your-codespace)".
You can personalize aspects of your codespace environment by using a public [dotfiles](https://dotfiles.github.io/tutorials/) repository. You can use dotfiles to set shell aliases and preferences, or to install your personal preference of the tools you like to use. If you use {% data variables.product.prodname_github_codespaces %} in the browser, or in {% data variables.product.prodname_vscode %}, you can use [Settings Sync](https://code.visualstudio.com/docs/editor/settings-sync) to give your codespace editor the same settings, keyboard shortcuts, snippets, and extensions that you have set up in your local installation of {% data variables.product.prodname_vscode %}.
For more information, see "[Customizing your codespace](/codespaces/customizing-your-codespace)".
## About billing for {% data variables.product.prodname_codespaces %}

View File

@@ -21,7 +21,7 @@ product: '{% data reusables.gated-features.codespaces %}'
## About dev containers
Development containers, or dev containers, are Docker containers that are specifically configured to provide a full-featured development environment. Whenever you work in a codespace, you are using a dev container on a virtual machine.
Development containers, or dev containers, are Docker containers that are specifically configured to provide a fully featured development environment. Whenever you work in a codespace, you are using a dev container on a virtual machine.
You can configure the dev container for a repository so that codespaces created for that repository give you a tailored development environment, complete with all the tools and runtimes you need to work on a specific project. If you don't define a configuration in the repository then {% data variables.product.prodname_github_codespaces %} uses a default configuration, which contains many of the common tools that your team might need for development with your project. For more information, see "[Using the default dev container configuration](#using-the-default-dev-container-configuration)."
@@ -122,7 +122,7 @@ The default configuration is a good option if you're working on a small project
## Using a predefined dev container configuration
You can choose from a list of predefined configurations to create a dev container configuration for your repository. These configurations provide common setups for particular project types, and can help you quickly get started with a configuration that already has the appropriate container options, {% data variables.product.prodname_vscode_shortname %} settings, and {% data variables.product.prodname_vscode_shortname %} extensions that should be installed.
If you use {% data variables.product.prodname_codespaces %} in {% data variables.product.prodname_vscode %}, or in a web browser, you can create a dev container configuration for your repository by choosing from a list of predefined configurations. These configurations provide common setups for particular project types, and can help you quickly get started with a configuration that already has the appropriate container options, {% data variables.product.prodname_vscode %} settings, and {% data variables.product.prodname_vscode %} extensions that should be installed.
Using a predefined configuration is a great idea if you need some additional extensibility. You can also start with a predefined configuration and amend it as needed for your project. For more information about the definitions of predefined dev containers, see the [`devcontainers/images`](https://github.com/devcontainers/images/tree/main/src) repository.
@@ -202,21 +202,27 @@ The `devcontainer.json` file is written using the JSONC (JSON with comments) for
{% endnote %}
### Editor settings for {% data variables.product.prodname_vscode_shortname %}
### Interface settings for {% data variables.product.prodname_vscode_shortname %}
{% data reusables.codespaces.vscode-settings-order %}
You can configure the interface settings for {% data variables.product.prodname_vscode_shortname %}, with three scopes: Workspace, Remote [Codespaces], and User. You can view these scopes in the {% data variables.product.prodname_vscode_shortname %} Settings editor.
You can define default editor settings for {% data variables.product.prodname_vscode_shortname %} in two places.
![Screenshot showing the choice of scopes in the Settings editor](/assets/images/help/codespaces/scopes-for-vscode.png)
* Editor settings defined in the `.vscode/settings.json` file in your repository are applied as _Workspace_-scoped settings in the codespace.
* Editor settings defined in the `settings` key in the `devcontainer.json` file are applied as _Remote [Codespaces]_-scoped settings in the codespace.
If a setting is defined in multiple scopes, Workspace settings take priority, then Remote [Codespaces], then User.
You can define default interface settings for {% data variables.product.prodname_vscode_shortname %} in two places.
* Interface settings defined in the `.vscode/settings.json` file in your repository are applied as Workspace-scoped settings in the codespace.
* Interface settings defined in the `settings` key in the `devcontainer.json` file are applied as Remote [Codespaces]-scoped settings in the codespace.
## Applying configuration changes to a codespace
{% data reusables.codespaces.apply-devcontainer-changes %}
Changes to a configuration will be applied the next time you create a codespace. However, if you're using a codespace in a web browser, in {% data variables.product.prodname_vscode_shortname %}, or in a JetBrains IDE, you can apply configuration changes to the current codespace by rebuilding the container.
### Rebuilding the dev container in the {% data variables.product.prodname_vscode_shortname %} web client or desktop application
{% data reusables.codespaces.rebuild-command %}
1. {% data reusables.codespaces.recovery-mode %} Fix the errors in the configuration.
1. {% data reusables.codespaces.recovery-mode %}
![Error message about recovery mode](/assets/images/help/codespaces/recovery-mode-error-message.png)
@@ -224,6 +230,17 @@ You can define default editor settings for {% data variables.product.prodname_vs
- To fix the errors identified in the logs, update your `devcontainer.json` file.
- To apply the changes, rebuild your container.
### Rebuilding the dev container in a JetBrains IDE
{% data reusables.codespaces.jetbrains-open-codespace-plugin %}
1. In the {% data variables.product.prodname_github_codespaces %} tool window, click the rebuild icon.
![Screenshot of the rebuild button](/assets/images/help/codespaces/jetbrains-plugin-icon-rebuild.png)
1. Click **Rebuild** when prompted to confirm that you want to rebuild the dev container.
1. Reopen the codespace in your JetBrains IDE.
## Further reading
- "[Prebuilding your codespaces](/codespaces/prebuilding-your-codespaces)"

View File

@@ -17,7 +17,7 @@ hidden: true
## Introduction
This guide shows you how to set up your C# (.NET) project in {% data variables.product.prodname_github_codespaces %}. It will take you through an example of opening your project in a codespace, and adding and modifying a dev container configuration from a template.
This guide shows you how to set up your C# (.NET) project {% data reusables.codespaces.setting-up-project-intro %}
### Prerequisites

View File

@@ -17,7 +17,7 @@ hidden: true
## Introduction
This guide shows you how to set up your Java project in {% data variables.product.prodname_github_codespaces %}. It will take you through an example of opening your project in a codespace, and adding and modifying a dev container configuration from a template.
This guide shows you how to set up your Java project {% data reusables.codespaces.setting-up-project-intro %}
### Prerequisites

View File

@@ -23,7 +23,7 @@ hidden: true
## Introduction
This guide shows you how to set up your JavaScript, Node.js, or TypeScript project in {% data variables.product.prodname_github_codespaces %}. It will take you through an example of opening your project in a codespace, and adding and modifying a dev container configuration from a template.
This guide shows you how to set up your JavaScript, Node.js, or TypeScript project {% data reusables.codespaces.setting-up-project-intro %}
### Prerequisites

View File

@@ -20,7 +20,7 @@ hidden: true
## Introduction
This guide shows you how to set up your Python project in {% data variables.product.prodname_github_codespaces %}. It will take you through an example of opening your project in a codespace, and adding and modifying a dev container configuration from a template.
This guide shows you how to set up your Python project {% data reusables.codespaces.setting-up-project-intro %}
### Prerequisites

View File

@@ -1,6 +1,6 @@
---
title: GitHub Codespaces logs
intro: 'Overview of the logging locations used by {% data variables.product.prodname_github_codespaces %}.'
intro: 'Overview of the logs used by {% data variables.product.prodname_github_codespaces %}.'
product: '{% data reusables.gated-features.codespaces %}'
versions:
fpt: '*'
@@ -15,18 +15,49 @@ redirect_from:
---
Information on {% data variables.product.prodname_github_codespaces %} is output to three different logs:
Information on {% data variables.product.prodname_github_codespaces %} is output to various logs:
{% webui %}
- Codespace logs
- Creation logs
- Extension logs ({% data variables.product.prodname_vscode %} desktop) or Browser console logs ({% data variables.product.prodname_vscode %} in the web)
- Browser console logs (for the {% data variables.product.prodname_vscode_shortname %} web client)
## Codespace logs
Extension logs are available if you are using {% data variables.product.prodname_github_codespaces %} in {% data variables.product.prodname_vscode_shortname %}. Click the "{% data variables.product.prodname_vscode %}" tab above for details.
These logs contain detailed information about the codespace, the container, the session, and the {% data variables.product.prodname_vscode %} environment. They are useful for diagnosing connection issues and other unexpected behavior. For example, the codespace freezes but the "Reload Windows" option unfreezes it for a few minutes, or you are randomly disconnected from the codespace but able to reconnect immediately.
{% endwebui %}
{% vscode %}
- Codespace logs
- Creation logs
- Extension logs (for the {% data variables.product.prodname_vscode_shortname %} desktop application)
Browser logs are available if you are using {% data variables.product.prodname_github_codespaces %} in your browser. Click the "Web browser" tab above for details.
{% endvscode %}
{% cli %}
- Codespace logs
- Creation logs
Other logs are available if you are using {% data variables.product.prodname_github_codespaces %} in {% data variables.product.prodname_vscode_shortname %} or in your web browser. Click the tabs above for details.
{% endcli %}
{% jetbrains %}
- Creation logs
Other logs are available if you are using {% data variables.product.prodname_github_codespaces %} in {% data variables.product.prodname_vscode_shortname %} or in your web browser. Click the tabs above for details.
{% endjetbrains %}
{% webui %}
{% data reusables.codespaces.codespace-logs %}
1. If you are using {% data variables.product.prodname_github_codespaces %} in the browser, ensure that you are connected to the codespace you want to debug.
1. Open the {% data variables.product.prodname_vscode_command_palette_shortname %} (<kbd>Shift</kbd>+<kbd>Command</kbd>+<kbd>P</kbd> (Mac) / <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>P</kbd> (Windows/Linux)) and type **Export logs**. Select **Codespaces: Export Logs** from the list to download the logs.
1. Define where to save the zip archive of logs then click **Save** (desktop) or click **OK** (web).
@@ -36,6 +67,8 @@ These logs contain detailed information about the codespace, the container, the
{% vscode %}
{% data reusables.codespaces.codespace-logs %}
1. Open the {% data variables.product.prodname_vscode_command_palette_shortname %} (<kbd>Shift</kbd>+<kbd>Command</kbd>+<kbd>P</kbd> (Mac) / <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>P</kbd> (Windows/Linux)) and type **Export logs**. Select **Codespaces: Export Logs** from the list to download the logs.
1. Define where to save the zip archive of logs then click **Save** (desktop) or click **OK** (web).
@@ -43,7 +76,9 @@ These logs contain detailed information about the codespace, the container, the
{% cli %}
Currently you can't use {% data variables.product.prodname_cli %} to access these logs. To access them, open your codespace in {% data variables.product.prodname_vscode %} or in a browser.
{% data reusables.codespaces.codespace-logs %}
Currently you can't use {% data variables.product.prodname_cli %} to access these logs. To access them, open your codespace in {% data variables.product.prodname_vscode_shortname %} or in a browser.
{% endcli %}
@@ -51,7 +86,6 @@ Currently you can't use {% data variables.product.prodname_cli %} to access thes
These logs contain information about the container, dev container, and their configuration. They are useful for debugging configuration and setup problems.
{% webui %}
1. Connect to the codespace you want to debug.
@@ -89,14 +123,20 @@ gh codespace logs -c <CODESPACE-NAME> > /path/to/logs.txt
{% endcli %}
{% vscode %}
## Extension logs
These logs are available for {% data variables.product.prodname_vscode %} desktop users only. They are useful if it seems like the {% data variables.product.prodname_github_codespaces %} extension or {% data variables.product.prodname_vscode %} editor are having issues that prevent creation or connection.
These logs are available for {% data variables.product.prodname_vscode_shortname %} desktop users only. They are useful if it seems like the {% data variables.product.prodname_github_codespaces %} extension or {% data variables.product.prodname_vscode_shortname %} editor are having issues that prevent creation or connection.
1. In {% data variables.product.prodname_vscode %}, open the Command Palette.
1. In {% data variables.product.prodname_vscode_shortname %}, open the Command Palette.
1. Type **Logs** and select **Developer: Open Extension Logs Folder** from the list to open the extension log folder in your system's file explorer.
From this view, you can access logs generated by the various extensions that you use in {% data variables.product.prodname_vscode %}. You will see logs for GitHub Codespaces, GitHub Authentication, and Git, in addition to any other extensions you have enabled.
From this view, you can access logs generated by the various extensions that you use in {% data variables.product.prodname_vscode_shortname %}. You will see logs for GitHub Codespaces, GitHub Authentication, and Git, in addition to any other extensions you have enabled.
{% endvscode %}
{% webui %}
## Browser console logs
@@ -106,3 +146,23 @@ These logs are useful only if you want to debug problems with using {% data vari
1. Display the "Console" tab and click **errors** in the left side bar to show only the errors.
1. In the log area on the right, right-click and select **Save as** to save a copy of the errors to your local machine.
![Save errors](/assets/images/help/codespaces/browser-console-log-save.png)
{% endwebui %}
{% jetbrains %}
{% data reusables.codespaces.jetbrains-open-codespace-plugin %}
1. In the {% data variables.product.prodname_github_codespaces %} tool window, click the log icon.
![Screenshot of the log button](/assets/images/help/codespaces/jetbrains-plugin-icon-log.png)
## JetBrains logs
You can download logs for the remote JetBrains IDE and the local client application by going to the **Help** menu in the JetBrains client application and clicking **Collect Host and Client Logs**.
{% endjetbrains %}
## Further reading
- "[Reviewing your organization's audit logs for GitHub Codespaces](/codespaces/managing-codespaces-for-your-organization/reviewing-your-organizations-audit-logs-for-github-codespaces)"
- "[Reviewing your security logs for GitHub Codespaces](/codespaces/managing-your-codespaces/reviewing-your-security-logs-for-github-codespaces)"

View File

@@ -19,7 +19,7 @@ children:
- /troubleshooting-prebuilds
- /troubleshooting-dotfiles-for-codespaces
- /troubleshooting-port-forwarding-for-github-codespaces
- /troubleshooting-codespaces-clients
- /troubleshooting-github-codespaces-clients
- /working-with-support-for-github-codespaces
---

View File

@@ -1,39 +0,0 @@
---
title: Troubleshooting GitHub Codespaces clients
allowTitleToDifferFromFilename: true
intro: 'You can use {% data variables.product.prodname_github_codespaces %} in your browser or through {% data variables.product.prodname_vscode %}. This article provides troubleshooting steps for common client issues.'
product: '{% data reusables.gated-features.codespaces %}'
versions:
fpt: '*'
ghec: '*'
type: reference
topics:
- Codespaces
shortTitle: Codespaces clients
---
## {% data variables.product.prodname_vscode %} troubleshooting
When you connect a desktop version of {% data variables.product.prodname_vscode %} to a codespace, you will notice few differences compared with working in a normal workspace but the experience will be fairly similar.
When you open a codespace in your browser using {% data variables.product.prodname_vscode %} in the web, you will notice more differences. For example, some key bindings will be different or missing, and some extensions may behave differently. For a summary, see: "[Known limitations and adaptions](https://code.visualstudio.com/docs/remote/codespaces#_known-limitations-and-adaptations)" in the {% data variables.product.prodname_vscode %} docs.
You can check for known issues and log new issues with the {% data variables.product.prodname_vscode %} experience in the [`microsoft/vscode`](https://github.com/microsoft/vscode/issues?q=is%3Aissue+is%3Aopen+codespaces) repository.
### {% data variables.product.prodname_vscode %} Insiders
{% data variables.product.prodname_vscode %} Insiders is the most frequent release of {% data variables.product.prodname_vscode %}. It has all the latest features and bug fixes, but may also occasionally contain new issues that result in a broken build.
If you are using an Insiders build and notice broken behavior, we recommend switching to {% data variables.product.prodname_vscode %} Stable and trying again.
On the desktop version of {% data variables.product.prodname_vscode %}, you can switch to Stable by closing the {% data variables.product.prodname_vscode %} Insiders application, opening the {% data variables.product.prodname_vscode %} Stable application, and re-opening your codespace.
On the web version of {% data variables.product.prodname_vscode %}, you can click {% octicon "gear" aria-label="The manage icon" %} in the bottom left of the editor and select **Switch to Stable Version...**. If the web version doesn't load or the {% octicon "gear" aria-label="The manage icon" %} icon isn't available, you can force switching to {% data variables.product.prodname_vscode %} Stable by appending `?vscodeChannel=stable` to your codespace URL and loading the codespace at that URL.
If the problem isn't fixed in {% data variables.product.prodname_vscode %} Stable, please follow the above troubleshooting instructions.
## Browser troubleshooting
If you encounter issues using codespaces in a browser that is not Chromium-based, try switching to a Chromium-based browser, or check for known issues with your browser in the `microsoft/vscode` repository by searching for issues labeled with the name of your browser, such as [`firefox`](https://github.com/microsoft/vscode/issues?q=is%3Aissue+is%3Aopen+label%3Afirefox) or [`safari`](https://github.com/Microsoft/vscode/issues?q=is%3Aopen+is%3Aissue+label%3Asafari).
If you encounter issues using codespaces in a Chromium-based browser, you can check if you're experiencing another known issue with {% data variables.product.prodname_vscode %} in the [`microsoft/vscode`](https://github.com/microsoft/vscode/issues) repository.

View File

@@ -14,7 +14,7 @@ shortTitle: Creation and deletion
## Creating codespaces
### No access to create a codespace
{% data variables.product.prodname_github_codespaces %} is not available for all repositories. If the "Open with Codespaces" button is missing, {% data variables.product.prodname_github_codespaces %} may not be available for that repository. For more information, see "[Creating a codespace](/codespaces/developing-in-codespaces/creating-a-codespace#access-to-codespaces)."
{% data variables.product.prodname_github_codespaces %} is not available for all repositories. If the codespace creation button is missing, {% data variables.product.prodname_github_codespaces %} may not be available for that repository. For more information, see "[Creating a codespace](/codespaces/developing-in-codespaces/creating-a-codespace#access-to-codespaces)."
You can't create a codespace for a private repository that's owned by an organization, unless you have write access to the repository or the organization has enabled forking for it.
@@ -64,9 +64,12 @@ If you create a codespace and the creation fails:
## Deleting codespaces
The owner of a codespace has full control over it and only they can delete their codespaces. You cannot delete a codespace created by another user.
A codespace can only be deleted by:
* The person who created the codespace.
* An organization owner for an organization-owned codespace.
* Automatic deletion at the end of a retention period.
You can delete your codespaces in the browser, in {% data variables.product.prodname_vscode %}, or by using {% data variables.product.prodname_cli %}. {% data variables.product.prodname_cli %} also allows you to bulk delete codespaces. For more information, see "[Deleting a codespace](/codespaces/developing-in-codespaces/deleting-a-codespace)."
For more information, see "[Deleting a codespace](/codespaces/developing-in-codespaces/deleting-a-codespace)" and "[Configuring automatic deletion of your codespaces](/codespaces/customizing-your-codespace/configuring-automatic-deletion-of-your-codespaces)."
## Container storage
@@ -89,5 +92,6 @@ Some more destructive options:
```
This codespace is currently running in recovery mode due to a container error.
```
Review the creation logs and update the dev container configuration as needed. For more information, see "[{% data variables.product.prodname_github_codespaces %} logs](/codespaces/troubleshooting/github-codespaces-logs)."
Review the creation logs, update the dev container configuration as needed, and run **Codespaces: Rebuild Container** in the {% data variables.product.prodname_vscode_command_palette %} to retry. For more information, see "[{% data variables.product.prodname_github_codespaces %} logs](/codespaces/troubleshooting/github-codespaces-logs)" and "[Introduction to dev containers](/codespaces/setting-up-your-project-for-codespaces/introduction-to-dev-containers)."
You can then try restarting the codespace, or rebuilding the container. For more information, see "[Introduction to dev containers](/codespaces/setting-up-your-project-for-codespaces/introduction-to-dev-containers#applying-configuration-changes-to-a-codespace)."

View File

@@ -0,0 +1,89 @@
---
title: Troubleshooting GitHub Codespaces clients
shortTitle: Codespaces clients
intro: 'This article provides troubleshooting information for issues you may encounter with the client you use for {% data variables.product.prodname_github_codespaces %}.'
product: '{% data reusables.gated-features.codespaces %}'
versions:
fpt: '*'
ghec: '*'
type: reference
topics:
- Codespaces
redirect_from:
- /codespaces/troubleshooting/troubleshooting-codespaces-clients
---
{% webui %}
## Troubleshooting the {% data variables.product.prodname_vscode %} web client
If you encounter issues using {% data variables.product.prodname_github_codespaces %} in a browser that is not Chromium-based, try switching to a Chromium-based browser, such as Google Chrome or Microsoft Edge. Alternatively, check for known issues with your browser in the [`microsoft/vscode`](https://github.com/microsoft/vscode/issues?q=is%3Aissue+is%3Aopen) repository by searching for issues labeled with the name of your browser, such as [`firefox`](https://github.com/microsoft/vscode/issues?q=is%3Aissue+is%3Aopen+label%3Afirefox) or [`safari`](https://github.com/Microsoft/vscode/issues?q=is%3Aopen+is%3Aissue+label%3Asafari).
If you encounter issues using {% data variables.product.prodname_github_codespaces %} in a Chromium-based browser, you can check if you're experiencing another known issue with {% data variables.product.prodname_vscode_shortname %} in the [`microsoft/vscode`](https://github.com/microsoft/vscode/issues?q=is%3Aissue+is%3Aopen) repository.
### Differences from working in {% data variables.product.prodname_vscode_shortname %} locally
When you open a codespace in your browser, using the {% data variables.product.prodname_vscode_shortname %} web client, you will notice some differences from working in a local workspace in the {% data variables.product.prodname_vscode_shortname %} desktop application. For example, some key bindings will be different or missing, and some extensions may behave differently. For a summary, see: "[Known limitations and adaptions](https://code.visualstudio.com/docs/remote/codespaces#_known-limitations-and-adaptations)" in the {% data variables.product.prodname_vscode_shortname %} docs.
You can check for known issues and log new issues with the {% data variables.product.prodname_vscode_shortname %} experience in the [`microsoft/vscode`](https://github.com/microsoft/vscode/issues?q=is%3Aissue+is%3Aopen+codespaces) repository.
### {% data variables.product.prodname_vscode %} Insiders
{% data variables.product.prodname_vscode %} Insiders is the most frequent release of {% data variables.product.prodname_vscode_shortname %}. It has all the latest features and bug fixes, but may also occasionally contain new issues that result in a broken build.
If you are using an Insiders build and notice broken behavior, we recommend switching to {% data variables.product.prodname_vscode %} Stable and trying again.
Click {% octicon "gear" aria-label="The manage icon" %} in the bottom left of the editor and select **Switch to Stable Version...**. If the {% data variables.product.prodname_vscode_shortname %} web client doesn't load, or the {% octicon "gear" aria-label="The manage icon" %} icon isn't available, you can force switching to {% data variables.product.prodname_vscode %} Stable by appending `?vscodeChannel=stable` to your codespace URL and loading the codespace at that URL.
If the problem isn't fixed in {% data variables.product.prodname_vscode %} Stable, check for known issues and, if required, log a new issue with the {% data variables.product.prodname_vscode_shortname %} experience, in the [`microsoft/vscode`](https://github.com/microsoft/vscode/issues?q=is%3Aissue+is%3Aopen+codespaces) repository.
{% endwebui %}
{% vscode %}
## {% data variables.product.prodname_vscode_shortname %} troubleshooting
When you open a codespace in the {% data variables.product.prodname_vscode_shortname %} desktop application, you may notice a few differences compared with working in a local workspace, but the experience should be similar.
If you encounter problems, you can check for known issues and log new issues with the {% data variables.product.prodname_vscode_shortname %} experience in the [`microsoft/vscode`](https://github.com/microsoft/vscode/issues?q=is%3Aissue+is%3Aopen+codespaces) repository.
### {% data variables.product.prodname_vscode %} Insiders
{% data variables.product.prodname_vscode %} Insiders is the most frequent release of {% data variables.product.prodname_vscode_shortname %}. It has all the latest features and bug fixes, but may also occasionally contain new issues that result in a broken build.
If you are using an Insiders build and notice broken behavior, we recommend switching to {% data variables.product.prodname_vscode %} Stable and trying again.
To switch to {% data variables.product.prodname_vscode %} Stable, close the {% data variables.product.prodname_vscode %} Insiders application, open the {% data variables.product.prodname_vscode %} Stable application, and re-open your codespace.
If the problem isn't fixed in {% data variables.product.prodname_vscode %} Stable, check for known issues and, if required, log a new issue with the {% data variables.product.prodname_vscode_shortname %} experience, in the [`microsoft/vscode`](https://github.com/microsoft/vscode/issues?q=is%3Aissue+is%3Aopen+codespaces) repository.
{% endvscode %}
{% jetbrains %}
## Troubleshooting JetBrains IDEs
### Performance issues
If the performance you are experiencing using a codespace in JetBrains feels a little sluggish, you may need to increase the maximum Java heap size.
1. Click **Localhost** at the left of the navigation bar, at the top of the application window.
![Screenshot of a the Localhost button in JetBrains](/assets/images/help/codespaces/jetbrains-localhost-button.png)
1. In the Performance tab, note the CPU Load and Memory details. These will indicate whether the machine is overloaded.
![Screenshot of a the Localhost button in JetBrains](/assets/images/help/codespaces/jetbrains-performance.png)
1. Click the Settings tab and edit the heap size, increasing it to no more than 60% of the available memory for your codespace.
![Screenshot of the maximum heap size setting](/assets/images/help/codespaces/jetbrains-heap-setting.png)
1. Click **Save and restart**.
### JetBrains IDE issues
For help with issues specific to the JetBrains IDE you are using, or the JetBrains Gateway application, see "[Product Support](https://www.jetbrains.com/support/)" on the JetBrains website.
{% endjetbrains %}

View File

@@ -18,7 +18,7 @@ featuredLinks:
- /github-cli/github-cli/creating-github-cli-extensions
- /github-cli/github-cli/using-github-cli-extensions
- /actions/guides/using-github-cli-in-workflows
- /codespaces/developing-in-codespaces/using-codespaces-with-github-cli
- /codespaces/developing-in-codespaces/using-github-codespaces-with-github-cli
popular:
- /github/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request
- /issues/tracking-your-work-with-issues/creating-an-issue

View File

@@ -129,7 +129,7 @@ You can define a default platform in the frontmatter. For more information, see
## Tool tags
We occasionally need to write documentation for different tools (GitHub UI, GitHub CLI, GitHub Desktop, cURL, Codespaces, VS Code, GitHub Enterprise Importer CLI, GraphQL API). Each tool may require a different set of instructions. We use tool tags to demarcate information for each tool. To modify the list of possible tools, edit [`lib/all-tools.js`](../lib/all-tools.js).
We occasionally need to write documentation for different tools (GitHub UI, GitHub CLI, GitHub Desktop, cURL, Codespaces, Visual Studio Code, JetBrains IDEs, GitHub Enterprise Importer CLI, GraphQL API). Each tool may require a different set of instructions. We use tool tags to demarcate information for each tool. To modify the list of possible tools, edit [`lib/all-tools.js`](../lib/all-tools.js).
To add a new tool, add an entry to the `allTools` object in `lib/all-tools.js` as a key-value pair. The key is the tag you'll use to refer to the tool in the article, the value is how the tool will be identified on the tool picker at the top of the article.
@@ -183,6 +183,14 @@ These instructions are pertinent to VS Code users.
{% endvscode %}
```
```
{% jetbrains %}
These instructions are pertinent to users of JetBrains IDEs.
{% endjetbrains %}
```
```
{% importer_cli %}

View File

@@ -1 +0,0 @@
You can also use a [dotfiles](https://dotfiles.github.io/tutorials/) repository and [Settings Sync](https://code.visualstudio.com/docs/editor/settings-sync) to personalize aspects of the codespace environment for any codespace that you create. Personalization can include shell preferences and additional tools.

View File

@@ -1 +0,0 @@
After the {% data variables.product.prodname_github_codespaces %} configuration for a repository changes, you can apply the changes to an existing codespace by rebuilding the container for the codespace.

View File

@@ -0,0 +1,3 @@
## Codespace logs
These logs contain detailed information about the codespace, the container, the session, and the {% data variables.product.prodname_vscode_shortname %} environment. They are useful for diagnosing connection issues and other unexpected behavior. For example, the codespace freezes but the "Reload Windows" option unfreezes it for a few minutes, or you are randomly disconnected from the codespace but able to reconnect immediately.

View File

@@ -1 +1 @@
You can connect to your codespace directly from {% data variables.product.prodname_vscode_shortname %}. For more information, see "[Using Codespaces in {% data variables.product.prodname_vscode_shortname %}](/github/developing-online-with-codespaces/using-codespaces-in-visual-studio-code)."
You can connect to your codespace directly from {% data variables.product.prodname_vscode_shortname %}. For more information, see "[Using Codespaces in {% data variables.product.prodname_vscode_shortname %}](/codespaces/developing-in-codespaces/using-github-codespaces-in-visual-studio-code)."

View File

@@ -0,0 +1,9 @@
[{% data variables.product.prodname_copilot %}](https://copilot.github.com/), an AI pair programmer, can be used in any codespace. For more information, see "[About GitHub Copilot](/copilot/overview-of-github-copilot/about-github-copilot)."
To start using {% data variables.product.prodname_copilot %} in {% data variables.product.prodname_github_codespaces %}, install the [{% data variables.product.prodname_copilot %} extension from the {% data variables.product.prodname_vscode_marketplace %}](https://marketplace.visualstudio.com/items?itemName=GitHub.copilot).
To include {% data variables.product.prodname_copilot %}, or other extensions, in all of your codespaces, enable Settings Sync. For more information, see "[Personalizing {% data variables.product.prodname_github_codespaces %} for your account](/codespaces/customizing-your-codespace/personalizing-github-codespaces-for-your-account#settings-sync)." Additionally, to include {% data variables.product.prodname_copilot %} in a given project for all users, you can specify `GitHub.copilot` as an extension in your `devcontainer.json` file. For information about configuring a `devcontainer.json` file, see "[Introduction to dev containers](/codespaces/customizing-your-codespace/configuring-codespaces-for-your-project#creating-a-custom-dev-container-configuration)."
## Further reading
- "[Getting started with GitHub Copilot in Visual Studio Code](/copilot/getting-started-with-github-copilot/getting-started-with-github-copilot-in-visual-studio-code)"

View File

@@ -0,0 +1,18 @@
### Customizing the codespaces for a repository
You can customize the codespaces that are created for a repository by creating or updating the dev container configuration for the repository. You can do this from within a codespace. After you change a dev container configuration, you can apply the changes to the current codespace by rebuilding the Docker container for the codespace. For more information, see "[Introduction to dev containers](/codespaces/setting-up-your-project-for-codespaces/introduction-to-dev-containers)."
### Personalizing your codespace
You can use a [dotfiles](https://dotfiles.github.io/tutorials/) repository and [Settings Sync](https://code.visualstudio.com/docs/editor/settings-sync) to personalize aspects of the codespace environment for any codespace that you create. Personalization can include shell preferences and additional tools. For more information, see "[Personalizing {% data variables.product.prodname_codespaces %} for your account](/codespaces/setting-up-your-codespace/personalizing-codespaces-for-your-account)."
### Running your app from a codespace
{% data reusables.codespaces.about-port-forwarding %} For more information, see "[Forwarding ports in your codespace](/github/developing-online-with-codespaces/forwarding-ports-in-your-codespace)."
### Committing your changes
{% data reusables.codespaces.committing-link-to-procedure %}
### Using the {% data variables.product.prodname_vscode_command_palette %}
The {% data variables.product.prodname_vscode_command_palette %} allows you to access and manage many features for {% data variables.product.prodname_codespaces %} and {% data variables.product.prodname_vscode %}. For more information, see "[Using the {% data variables.product.prodname_vscode_command_palette %} in {% data variables.product.prodname_codespaces %}](/codespaces/codespaces-reference/using-the-vs-code-command-palette-in-codespaces)."

View File

@@ -0,0 +1,3 @@
1. In the JetBrains client, click the {% data variables.product.prodname_github_codespaces %} plugin to display the {% data variables.product.prodname_github_codespaces %} tool window.
![Screenshot of the {% data variables.product.prodname_github_codespaces %} tool window](/assets/images/help/codespaces/jetbrains-codespaces-tool-window.png)

View File

@@ -0,0 +1,8 @@
## Navigating to an existing codespace
1. {% data reusables.codespaces.you-can-see-all-your-codespaces %}
1. 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 of your codespaces for a specific 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

@@ -0,0 +1,16 @@
If you have set the JetBrains Gateway as your default editor, then the Gateway will launch automatically when you open a codespace from {% data variables.product.prodname_dotcom_the_website %}. You can also open the JetBrains Gateway and select an existing codespace, as described in the following procedure.
1. Open the JetBrains Gateway application.
1. Click **Connect to {% data variables.product.prodname_codespaces %}**.
![Screenshot of the JetBrains Gateway initial view](/assets/images/help/codespaces/jetbrains-gateway-connect.png)
1. In the "Your Codespaces" list, click the codespace you want to work in.
![Screenshot of the JetBrains Gateway codespace list](/assets/images/help/codespaces/jetbrains-gateway-codespaces.png)
1. In the "Available IDEs" list, click the JetBrains IDE you want to use. The Gateway will remember your choice the next time you connect to a codespace.
![Screenshot of the JetBrains Gateway codespace list](/assets/images/help/codespaces/jetbrains-gateway-ides.png)
1. Click **Connect**.

View File

@@ -0,0 +1,10 @@
## Adding a port to the codespace configuration
You can add a forwarded port to the {% data variables.product.prodname_github_codespaces %} configuration for the repository, so the port will automatically be forwarded for all codespaces created from the repository. After you update the configuration, any previously created codespaces must be rebuilt for the change to apply. For more information, see "[Introduction to dev containers](/codespaces/setting-up-your-project-for-codespaces/introduction-to-dev-containers#applying-configuration-changes-to-a-codespace)."
You can manually configure forwarded ports in a `.devcontainer.json` file using the `forwardPorts` property, or you can use the "Ports" panel in a codespace that you've opened in the browser or the {% data variables.product.prodname_vscode_shortname %} desktop application.
{% data reusables.codespaces.navigate-to-ports-tab %}
1. Right click the port you want to add to the codespace configuration, then click **Set Label and Update devcontainer.json**.
![Option to set label and add port to devcontainer.json in the right-click menu](/assets/images/help/codespaces/update-devcontainer-to-add-port-option.png)
{% data reusables.codespaces.type-port-label %}

View File

@@ -0,0 +1,15 @@
When an application running inside a codespace prints output to the terminal that contains a localhost URL, such as `http://localhost:PORT` or `http://127.0.0.1:PORT`, the port is automatically forwarded. If you're using {% data variables.product.prodname_github_codespaces %} in the browser or in {% data variables.product.prodname_vscode %}, the URL string in the terminal is converted into a link that you can click to view the web page on your local machine. By default, {% data variables.product.prodname_github_codespaces %} forwards ports using HTTP.
![Automatic port forwarding](/assets/images/help/codespaces/automatic-port-forwarding.png)
You can also forward a port manually, label forwarded ports, share forwarded ports with members of your organization, share forwarded ports publicly, and add forwarded ports to the codespace configuration.
{% note %}
**Note**: {% data reusables.codespaces.restrict-port-visibility %}
{% endnote %}
## Forwarding a port
You can manually forward a port that wasn't forwarded automatically.

View File

@@ -0,0 +1,8 @@
## Labeling a port
When you open a codespace in the browser, or in the {% data variables.product.prodname_vscode_shortname %} desktop application, you can label a forwarded port to make it easier to identify in a list.
{% data reusables.codespaces.navigate-to-ports-tab %}
1. Hover over the port you want to label, then click the label icon.
![Label icon for port](/assets/images/help/codespaces/label-icon.png)
{% data reusables.codespaces.type-port-label %}

View File

@@ -0,0 +1,15 @@
## Sharing a port
{% note %}
**Note:** You can only make a port private to an organization if your organization uses {% data variables.product.prodname_team %} or {% data variables.product.prodname_ghe_cloud %}.
{% endnote %}
If you want to share a forwarded port with others, you can either make the port private to your organization or make the port public. After you make a port private to your organization, anyone in the organization with the port's URL can view the running application. After you make a port public, anyone who knows the URL and port number can view the running application without needing to authenticate.
{% note %}
**Note:** Your choice of port visibility options may be limited by a policy configured for your organization. For more information, see "[Restricting the visibility of forwarded ports](/codespaces/managing-codespaces-for-your-organization/restricting-the-visibility-of-forwarded-ports)."
{% endnote %}

View File

@@ -1,9 +0,0 @@
1. Open the pull request in a codespace, as described in "[Opening a pull request](/codespaces/developing-in-codespaces/using-codespaces-for-pull-requests#opening-a-pull-request-in-codespaces)."
2. In the Activity Bar, click the **GitHub Pull Request** view. This view only appears when you open a pull request in a codespace.
![Option to open PR in a codespace](/assets/images/help/codespaces/github-pr-view.png)
3. To review a specific file, click the **Open File** icon in the Side Bar.
![Option to open PR in a codespace](/assets/images/help/codespaces/changes-in-files.png)
4. To add review comments, click the **+** icon next to the line number. Type your review comment and then click **Start Review**.
![Option to open PR in a codespace](/assets/images/help/codespaces/start-review.png)
5. When you are finished adding review comments, from the Side Bar you can choose to either submit the comments, approve the changes, or request changes.
![Option to open PR in a codespace](/assets/images/help/codespaces/submit-review.png)

View File

@@ -0,0 +1 @@
in {% data variables.product.prodname_codespaces %} using either the {% data variables.product.prodname_vscode %} desktop application, or the {% data variables.product.prodname_vscode_shortname %} web client. It will take you through an example of opening your project in a codespace, and adding and modifying a dev container configuration from a template.

View File

@@ -0,0 +1,51 @@
## Creating or switching branches
{% data reusables.codespaces.create-or-switch-branch %}
{% tip %}
**Tip**: If someone has recently changed a file on the remote repository, in the branch you switched to, you may not see those changes until you pull the changes into your codespace.
{% endtip %}
## Committing your changes
{% data reusables.codespaces.source-control-commit-changes %}
## Pulling changes from the remote repository
You can pull changes from the remote repository into your codespace at any time.
{% data reusables.codespaces.source-control-display-dark %}
1. At the top of the side bar, click the ellipsis (**...**).
![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 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 "[Introduction to dev containers](/codespaces/setting-up-your-codespace/configuring-codespaces-for-your-project#applying-changes-to-your-configuration)."
## Setting your codespace to automatically fetch new changes
You can set your codespace to automatically fetch details of any new commits that have been made to the remote repository. This allows you to see whether your local copy of the repository is out of date, in which case you may choose to pull in the new changes.
If the fetch operation detects new changes on the remote repository, you'll see the number of new commits in the status bar. You can then pull the changes into your local copy.
1. Click the **Manage** button at the bottom of the Activity Bar.
![Manage button](/assets/images/help/codespaces/manage-button.png)
1. In the menu, slick **Settings**.
1. On the Settings page, search for: `autofetch`.
![Search for autofetch](/assets/images/help/codespaces/autofetch-search.png)
1. To fetch details of updates for all remotes registered for the current repository, set **Git: Autofetch** to `all`.
![Enable Git autofetch](/assets/images/help/codespaces/autofetch-all.png)
1. If you want to change the number of seconds between each automatic fetch, edit the value of **Git: Autofetch Period**.
## Raising a pull request
{% data reusables.codespaces.source-control-pull-request %}
## Pushing changes to your remote repository
You can push changes you've saved and committed. This applies those changes to the upstream branch on the remote repository. You might want to do this if you're not yet ready to create a pull request, or if you prefer to create a pull request on {% data variables.product.prodname_dotcom %}.
1. At the top of the side bar, click the ellipsis (**...**).
![Ellipsis button for View and More Actions](/assets/images/help/codespaces/source-control-ellipsis-button-nochanges.png)
1. In the drop-down menu, click **Push**.

Some files were not shown because too many files have changed in this diff Show More