1
0
mirror of synced 2025-12-19 18:10:59 -05:00
Files
docs/content/codespaces/developing-in-a-codespace/opening-an-existing-codespace.md
Joe Clark 75f3cce197 October 28-30: GitHub Universe 2024 docs-internal megabranch (#52491)
Co-authored-by: isaacmbrown <isaacmbrown@github.com>
Co-authored-by: Hector Alfaro <hectorsector@github.com>
Co-authored-by: Isaac Brown <101839405+isaacmbrown@users.noreply.github.com>
Co-authored-by: hubwriter <hubwriter@github.com>
Co-authored-by: Vanessa <vgrl@github.com>
Co-authored-by: Christopher Nguyen <91625426+nguyen-dows@users.noreply.github.com>
Co-authored-by: Sophie <29382425+sophietheking@users.noreply.github.com>
Co-authored-by: Felicity Chapman <felicitymay@github.com>
Co-authored-by: Andrew Eisenberg <aeisenberg@github.com>
Co-authored-by: Ben Ahmady <32935794+subatoi@users.noreply.github.com>
Co-authored-by: Sam Browning <106113886+sabrowning1@users.noreply.github.com>
Co-authored-by: David Staheli <1767415+davidstaheli@users.noreply.github.com>
Co-authored-by: Sarita Iyer <66540150+saritai@users.noreply.github.com>
Co-authored-by: sunbrye <sunbrye@github.com>
Co-authored-by: Tim Rogers <timrogers@github.com>
Co-authored-by: Felix Guntrip <stevecat@github.com>
Co-authored-by: Sunbrye Ly <56200261+sunbrye@users.noreply.github.com>
Co-authored-by: James Fletcher <42464962+jf205@users.noreply.github.com>
Co-authored-by: Rachael Rose Renk <91027132+rachaelrenk@users.noreply.github.com>
Co-authored-by: Jules <19994093+jules-p@users.noreply.github.com>
Co-authored-by: Laura Coursen <lecoursen@github.com>
Co-authored-by: Jules Porter <jules-p@users.noreply.github.com>
Co-authored-by: Devraj Mehta <devm33@github.com>
Co-authored-by: Kate Studwell <katestud@github.com>
Co-authored-by: Katherine Oelsner <49968061+octokatherine@users.noreply.github.com>
Co-authored-by: Rachael Sewell <rachmari@github.com>
Co-authored-by: Tim Rogers <me@timrogers.co.uk>
Co-authored-by: Arfon Smith <arfon@users.noreply.github.com>
2024-10-29 08:40:06 -07:00

7.6 KiB

title, intro, versions, type, topics, shortTitle, redirect_from
title intro versions type topics shortTitle redirect_from
Opening an existing codespace You can reopen a codespace that you have closed or stopped and return to your work.
fpt ghec
* *
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 %}

{% jetbrains_beta %}

{% data reusables.codespaces.codespaces-jetbrains-beta-note %}

{% endjetbrains_beta %}

You can reopen any of your active or stopped codespaces on {% data variables.product.github %}, 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. 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 %}

    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.

    {% endnote %}

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.

    Screenshot of the "Open in" dialog, with "Open in {% data variables.product.prodname_vscode %}" highlighted.

    You can open the codespace in:

    • Your browser
    • {% data variables.product.prodname_vscode %}
    • JetBrains Gateway
    • 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 %}

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

{% endnote %}

  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 %}

      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.

      {% endnote %}

    • To open a codespace in the browser, enter:

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

      gh codespace jupyter
      

      {% note %}

      Note: {% data reusables.codespaces.jupyterlab-installed-in-codespace %}

      {% endnote %}

    • 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 %}

{% jetbrains_beta %}

Reopening an existing codespace

{% data reusables.codespaces.opening-codespace-in-jetbrains %}

{% endjetbrains_beta %}

Further reading