Skip to content

Latest commit

 

History

History
149 lines (96 loc) · 6.98 KB

opening-an-existing-codespace.md

File metadata and controls

149 lines (96 loc) · 6.98 KB
titleintroversionstypetopicsshortTitleredirect_from
Opening an existing codespace
You can reopen a codespace that you have closed or stopped and return to your work.
fptghec
*
*
how_to
Codespaces
Fundamentals
Developer
Open an existing codespace
/codespaces/developing-in-codespaces/opening-an-existing-codespace

{% ifversion ghec %}

{% data reusables.codespaces.data-residency-availability %}

{% endif %}

You can reopen any of your active or stopped codespaces on {% data variables.product.github %}, in {% data variables.product.prodname_vscode %}, or by using {% data variables.product.prodname_cli %}. You can't reopen a codespace that has been deleted. See AUTOTITLE.

You can view all your codespaces on the "Your codespaces" page at github.com/codespaces. From this page, you can:

  • Open, stop, or delete your codespaces.
  • See who owns (and may be billed for) your codespaces: your personal account, or organizations you belong to. See AUTOTITLE.
  • See the machine type, size, and status of your codespaces.
  • Create a new codespace, either by choosing one of {% data variables.product.company_short %}'s templates or by clicking New codespace. See AUTOTITLE and AUTOTITLE.
  • Prevent automatic deletion of a codespace. See AUTOTITLE.

{% webui %}

Resuming a codespace from a repository page

You can quickly resume a codespace when you're viewing a repository on {% data variables.product.github %}.

  1. With the {% octicon "code" aria-hidden="true" %} Code tab of your repository displayed on {% data variables.product.github %}, press , (the comma key).

    The "Resume codespace" page is displayed. This allows you to resume your most recently used codespace for the currently selected branch of the repository or, if you were viewing a pull request, for the topic branch of the pull request.

    Screenshot of the "Resume codespace" page showing the "Resume this codespace" and "Create a new one" buttons.

  2. Click Resume this codespace.

    Alternatively, if you want to create a new codespace for this branch of the repository, click Create a new one.

    [!NOTE] If you don't have an existing codespace for this branch, the page is titled "Create codespace" and a button labeled Create a new codespace is displayed.

You can bookmark the address of this page if you want to get back to it quickly to resume your codespace. Alternatively you can use the address in a link to provide other people with a quick way of creating and resuming their own codespaces for this repository.

Opening an existing codespace from the "Your codespaces" page

{% data reusables.codespaces.your-codespaces-procedure-step %}

  1. To open a codespace in your default editor, click the name of the codespace. {% data reusables.codespaces.about-changing-default-editor %} See AUTOTITLE.

    To open the codespace in an editor other than your default:

    1. Click the ellipsis (...) to the right of the codespace you want to open.
    2. Click Open in.
    3. Click Open in APPLICATION.

    You can open the codespace in:

    • Your browser
    • {% data variables.product.prodname_vscode %}
    • JupyterLab

    {% data reusables.codespaces.application-installed-locally %}

    If you choose JupyterLab, the JupyterLab application must be installed in the codespace. {% data reusables.codespaces.jupyterlab-in-default-image %}

{% data reusables.codespaces.linking-to-an-existing-codespace %}

{% endwebui %}

{% vscode %}

Reopening an existing codespace

Note

{% data reusables.codespaces.using-codespaces-in-vscode %} See AUTOTITLE.

  1. In the {% data variables.product.prodname_vscode_shortname %} desktop application, open the Command Palette with Command+Shift+P (Mac) or Ctrl+Shift+P (Windows/Linux).

  2. Type "Codespaces" and select one of the following commands.

    • To open a codespace in a new window of {% data variables.product.prodname_vscode_shortname %}, select Codespaces: Open Codespace in New Window
    • To open a codespace in the web editor, select Codespaces: Open in Browser
  3. Click the codespace that you want to open.

    Screenshot of the {% data variables.product.prodname_vscode_shortname %} Command Palette showing a list of codespaces available to connect to.

You can also access the commands listed above by navigating to the Remote Explorer view in {% data variables.product.prodname_vscode_shortname %} and right-clicking the codespace that you want to open.

Screenshot of a codespace selected in the Remote Explorer, with "Open in Browser" highlighted in the right-click menu.

{% data reusables.codespaces.remote-explorer %}

{% data reusables.codespaces.linking-to-an-existing-codespace %}

{% endvscode %}

{% cli %}

Reopening an existing codespace

{% data reusables.codespaces.using-github-cli %}

  1. In a terminal, enter one of the following {% data variables.product.prodname_cli %} commands.

    • To open a codespace in {% data variables.product.prodname_vscode_shortname %}, enter:

      gh codespace code

      [!NOTE] You must have {% data variables.product.prodname_vscode_shortname %} installed on your local machine. See Setting up {% data variables.product.prodname_vscode %} in the {% data variables.product.prodname_vscode_shortname %} documentation.

    • To open a codespace in the browser, enter:

      gh codespace code --web
    • To open a codespace in JupyterLab, enter:

      gh codespace jupyter

      [!NOTE] {% data reusables.codespaces.jupyterlab-installed-in-codespace %}

    • To access a codespace from the command line, over SSH, enter:

      gh codespace ssh
  2. Using the arrow keys, navigate to the codespace that you want to open.

  3. To open the codespace, press Enter.

See gh codespace code in the {% data variables.product.prodname_cli %} manual.

{% endcli %}

Further reading

close