1
0
mirror of synced 2025-12-20 10:28:40 -05:00
Files
docs/content/codespaces/developing-in-codespaces/creating-a-codespace.md
hubwriter 79285d5e92 [23 Feb]: Codespaces prebuilds- [Public Beta] (#25066)
* Draft - add copy from Google doc

* Add images

* More WiP

* test (#25121)

* Update actions-scheduled-workflow-example.md

The editor when changing a CRON time says the most frequent is 5 minutes. Either this section is incorrect or the editor pop over..

* Fix "labels" type

* Add apps permissions for code scanning org endpoint. (#24859)

* cope with possible translation drift (#24842)

* cope with possible translation drift

* fix test

* don't shallow clone

* fix unit tests

* update code comments

* more code comment corrections

* more code comment

* feedbacked

* Add 💅

* Remove yzhang.markdown-all-in-one extension

The markdown-all-in-one extension prevents Alfred expansions happening correctly.

* Revert Add apps permissions for code scanning org endpoint (#25023)

* Add security overview to github-security-features.md

* updating ghcr_token github_token

* archived asset redirects (#25025)

* updating ghec_token to github_token

* set 'manul-purge' surrogate key on assets/cb- URLs (#25028)

* Member privileges edit for forking help doc (#24934)

* calm down Backfill logging (#25031)

* [Feb. 2, 2022] Updates for settings nav redesign (#24604)

* Replace accessibility-tab.png with octicon

* Update and version appearance-tab references

* Replace codespaces-tab.png with octicon

* Replace product name with reusable

* Version reusable using developer-settings.png

* Version reusable using notifcations_menu.png

* Replace org-settings-pages.png with octicon

* Version reusable using repos-tab.png

* Version reusable using saved-replies-tab.png

* Version reusable with settings-applications.png

* Version reusable with settings-sidebar-account-security.png

* version reusable with settings-sidebar-account-settings.png

* Replace settings-sidebar-billing-plans.png with octicon

* Replace settings-sidebar-blocked-users.png with octicon

* Version settings-sidebar-deploy-keys.png

* Version reusable with settings-sidebar-emails.png

* Replace settings-sidebar-interaction-limits.png with octicon

* Replace settings-sidebar-organizations.png with octicon

* Version use of settings-sidebar-repositories.png

* Version reusable with settings-seidebar-security-analysis.png

* Version reusable with settings-sidebar-ssh-keys.png

* Version reusable with settings-sidebar-team-settings.png

* Replace settings-sidebar-third-party-access.png with octicon

* Version reusable with settings-user-orgs.png

* Replace user-settings-pages.png with octicon

* Update pages octicon

* Add explicit versions to elsif tags

* Rewording for consistency

* Improve versioning for future GHAE

* Add missing space

Co-authored-by: Felicity Chapman <felicitymay@github.com>

Co-authored-by: Felicity Chapman <felicitymay@github.com>

* update search indexes

* New translation batch for es (#25035)

* Add crowdin translations

* Run script/i18n/homogenize-frontmatter.js

* Run script/i18n/fix-translation-errors.js

* Run script/i18n/lint-translation-files.js --check parsing

* run script/i18n/reset-files-with-broken-liquid-tags.js --language=es

* run script/i18n/reset-known-broken-translation-files.js

* Check in es CSV report

* Remove duplicated word (#24974)

* Fix when we show the 'All Enterprise Releases' link (#25002)

* Enterprise versions start with 'enterprise-server'

* Show only if all versions are ghes versions

* Show link if there's any ghes versioning

* Depend on the path for the tool switcher (#25018)

* Azure: use shared env setter, fix comment workflow (#25044)

* update azure deployments to use shared env getter, fix content changes table

* update search indexes

* update search indexes

* Update workflow-syntax-for-github-actions.md

* New translation batch for pt (#25050)

* Add crowdin translations

* Run script/i18n/homogenize-frontmatter.js

* Run script/i18n/fix-translation-errors.js

* Run script/i18n/lint-translation-files.js --check parsing

* run script/i18n/reset-files-with-broken-liquid-tags.js --language=pt

* run script/i18n/reset-known-broken-translation-files.js

* update search indexes

* The missing full stop was added.

* update search indexes

* update search indexes

* New translation batch for pt (#25057)

* Add crowdin translations

* Run script/i18n/homogenize-frontmatter.js

* Run script/i18n/fix-translation-errors.js

* Run script/i18n/lint-translation-files.js --check parsing

* run script/i18n/reset-files-with-broken-liquid-tags.js --language=pt

* run script/i18n/reset-known-broken-translation-files.js

* New translation batch for es (#25058)

* Add crowdin translations

* Run script/i18n/homogenize-frontmatter.js

* Run script/i18n/fix-translation-errors.js

* Run script/i18n/lint-translation-files.js --check parsing

* run script/i18n/reset-files-with-broken-liquid-tags.js --language=es

* run script/i18n/reset-known-broken-translation-files.js

* update search indexes

* update search indexes

* Update OpenAPI  Descriptions (#25047)

* update search indexes

* Enterprise bug fixes: week of Jan 31, 2022 (#25043)

* delete the workflow linter (#25075)

* an empty 'product', 'permissions', or 'learningTracks' gets stuck (#25070)

* and empty 'this.product' gets stuck

* add test to prove change

* Update OpenAPI  Descriptions (#25071)

* Update OpenAPI  Descriptions (#25076)

* Update OpenAPI  Descriptions

* Add decorated OpenAPI schema files

Co-authored-by: github-openapi-bot <github-openapi-bot@users.noreply.github.com>

* basic tests of the search API (#25069)

* basic tests of the search API

* lfs

* Revert "Revert Add apps permissions for code scanning org endpoint (#25023)" (#25026)

* update website-scraper to update transitive nth-check dep (#25080)

* update search indexes

* New translation batch for es (#25088)

* Add crowdin translations

* Run script/i18n/homogenize-frontmatter.js

* Run script/i18n/fix-translation-errors.js

* Run script/i18n/lint-translation-files.js --check parsing

* run script/i18n/reset-files-with-broken-liquid-tags.js --language=es

* run script/i18n/reset-known-broken-translation-files.js

* Update code-scanning-alert.png (#25072)

* use manual surrogate key for nextjs static assets (#25096)

* use manual surrogate key for nextjs static assets

* refactor

* update search indexes

* Update differences-between-clustering-and-high-availability-ha.md (#25107)

* Update OpenAPI  Descriptions (#25104)

* Add versioning for GHAE 3.3 (#24936)

* Update content/code-security/getting-started/github-security-features.md

* update search indexes

* [Actions] `push` event does not have Activity types (#15124)

* 📝 Clarify usage of single quotes in string datatype for literals (#14895)

* Fix value of GITHUB_REF for release events (#14876)

* New translation batch for pt (#25084)

* Add crowdin translations

* Run script/i18n/homogenize-frontmatter.js

* Run script/i18n/fix-translation-errors.js

* Run script/i18n/lint-translation-files.js --check parsing

* run script/i18n/reset-files-with-broken-liquid-tags.js --language=pt

* run script/i18n/reset-known-broken-translation-files.js

Co-authored-by: Mike Surowiec <mikesurowiec@users.noreply.github.com>

* New translation batch for ja (#25093)

* Add crowdin translations

* Run script/i18n/homogenize-frontmatter.js

* Run script/i18n/lint-translation-files.js --check parsing

* run script/i18n/reset-files-with-broken-liquid-tags.js --language=ja

* run script/i18n/reset-known-broken-translation-files.js

* Check in ja CSV report

Co-authored-by: Mike Surowiec <mikesurowiec@users.noreply.github.com>

* New translation batch for cn (#25090)

* Add crowdin translations

* Run script/i18n/homogenize-frontmatter.js

* Run script/i18n/lint-translation-files.js --check parsing

* Run script/i18n/lint-translation-files.js --check rendering

* run script/i18n/reset-files-with-broken-liquid-tags.js --language=cn

* run script/i18n/reset-known-broken-translation-files.js

* Check in cn CSV report

Co-authored-by: Mike Surowiec <mikesurowiec@users.noreply.github.com>

* Create github-debian.sh

* Update Dockerfile

* Update procedures for personal account recovery with two-factor authentication (#25040)

* delete old deploy.js script (#24862)

Co-authored-by: Mark Battistella <markbattistella@users.noreply.github.com>
Co-authored-by: Emily Grace Seville <emilyseville7cf@gmail.com>
Co-authored-by: Octomerger Bot <63058869+Octomerger@users.noreply.github.com>
Co-authored-by: Anders Starcke Henriksen <starcke@github.com>
Co-authored-by: Peter Bengtsson <mail@peterbe.com>
Co-authored-by: Laura Coursen <lecoursen@github.com>
Co-authored-by: lucie-docs <40564413+lucie-docs@users.noreply.github.com>
Co-authored-by: Josh Johanning <joshjohanning@github.com>
Co-authored-by: Tahlia G <84726379+tahlialouisa@users.noreply.github.com>
Co-authored-by: Ethan Palm <56270045+ethanpalm@users.noreply.github.com>
Co-authored-by: Felicity Chapman <felicitymay@github.com>
Co-authored-by: GitHub Actions <action@github.com>
Co-authored-by: docubot <67483024+docubot@users.noreply.github.com>
Co-authored-by: Simon Giesemann <kwacky1@github.com>
Co-authored-by: Robert Sese <rsese@github.com>
Co-authored-by: Mike Surowiec <mikesurowiec@users.noreply.github.com>
Co-authored-by: Albin PK <56157868+albinpk@users.noreply.github.com>
Co-authored-by: Dasun Tharanga <dasuntharangaflash@gmail.com>
Co-authored-by: github-openapi-bot <69533958+github-openapi-bot@users.noreply.github.com>
Co-authored-by: Ramya Parimi <33761166+ramyaparimi@users.noreply.github.com>
Co-authored-by: github-openapi-bot <github-openapi-bot@users.noreply.github.com>
Co-authored-by: Matt Pollard <mattpollard@users.noreply.github.com>
Co-authored-by: Dorothy Mitchell <dorothymitchell@github.com>
Co-authored-by: Andy J <mumfy@github.com>
Co-authored-by: mc <42146119+mchammer01@users.noreply.github.com>
Co-authored-by: Marko Kaznovac <kaznovac@users.noreply.github.com>
Co-authored-by: Anil Seervi <61609033+AnilSeervi@users.noreply.github.com>
Co-authored-by: Johanan Idicula <johanan@forcepush.tech>

* Add more screenshots

* complete items on plan

* Revert changes to files I didn't change

* Minor tweaks

* Update content/codespaces/customizing-your-codespace/prebuilding-codespaces-for-your-project.md

* Update content/codespaces/customizing-your-codespace/prebuilding-codespaces-for-your-project.md

* Update content/codespaces/customizing-your-codespace/prebuilding-codespaces-for-your-project.md

Co-authored-by: Jackie Jiménez <jaclynj@github.com>

* Update content/codespaces/customizing-your-codespace/prebuilding-codespaces-for-your-project.md

* Update content/codespaces/customizing-your-codespace/prebuilding-codespaces-for-your-project.md

* Update content/codespaces/customizing-your-codespace/prebuilding-codespaces-for-your-project.md

Co-authored-by: Jackie Jiménez <jaclynj@github.com>

* Remove detail about building prebuilds by rerunning a workflow

After deleting a prebuild configuration anyone who can access the workflow history can recreate the prebuilds by rerunning the previous workflow run - unless you go through manually deleting all of those entries from the workflow history. Removed this information as per review comment.

* Update content/codespaces/customizing-your-codespace/prebuilding-codespaces-for-your-project.md

Co-authored-by: Jackie Jiménez <jaclynj@github.com>

* Update content/codespaces/customizing-your-codespace/prebuilding-codespaces-for-your-project.md

* Update content/codespaces/customizing-your-codespace/prebuilding-codespaces-for-your-project.md

* Update content/codespaces/customizing-your-codespace/prebuilding-codespaces-for-your-project.md

Co-authored-by: Jackie Jiménez <jaclynj@github.com>

* Update content/codespaces/customizing-your-codespace/prebuilding-codespaces-for-your-project.md

* Update content/codespaces/customizing-your-codespace/prebuilding-codespaces-for-your-project.md

* Update content/codespaces/customizing-your-codespace/prebuilding-codespaces-for-your-project.md

* Update content/codespaces/customizing-your-codespace/prebuilding-codespaces-for-your-project.md

Co-authored-by: Jackie Jiménez <jaclynj@github.com>

* Update content/codespaces/customizing-your-codespace/prebuilding-codespaces-for-your-project.md

* Update content/codespaces/customizing-your-codespace/prebuilding-codespaces-for-your-project.md

Co-authored-by: Jackie Jiménez <jaclynj@github.com>

* Update content/codespaces/customizing-your-codespace/prebuilding-codespaces-for-your-project.md

* Update content/codespaces/customizing-your-codespace/prebuilding-codespaces-for-your-project.md

* Update content/codespaces/customizing-your-codespace/prebuilding-codespaces-for-your-project.md

* Update content/codespaces/customizing-your-codespace/prebuilding-codespaces-for-your-project.md

Co-authored-by: Jackie Jiménez <jaclynj@github.com>

* Update content/codespaces/customizing-your-codespace/prebuilding-codespaces-for-your-project.md

* Update data/reusables/codespaces/billing-for-prebuilds.md

* Update data/reusables/codespaces/billing-for-prebuilds.md

* Restructure info into separate articles

* Update content/codespaces/prebuilding-your-codespaces/about-codespaces-prebuilds.md

Co-authored-by: Laura Coursen <lecoursen@github.com>

* Move prerequisites section

* Move billing info

* Update content/codespaces/prebuilding-your-codespaces/configuring-prebuilds.md

Co-authored-by: Laura Coursen <lecoursen@github.com>

* Update content/codespaces/prebuilding-your-codespaces/configuring-prebuilds.md

Co-authored-by: Laura Coursen <lecoursen@github.com>

* Update content/codespaces/prebuilding-your-codespaces/configuring-prebuilds.md

Co-authored-by: Laura Coursen <lecoursen@github.com>

* Update content/codespaces/prebuilding-your-codespaces/managing-prebuilds.md

Co-authored-by: Laura Coursen <lecoursen@github.com>

* Update content/codespaces/prebuilding-your-codespaces/managing-prebuilds.md

Co-authored-by: Laura Coursen <lecoursen@github.com>

* Update content/codespaces/prebuilding-your-codespaces/managing-prebuilds.md

Co-authored-by: Laura Coursen <lecoursen@github.com>

* Update content/codespaces/prebuilding-your-codespaces/managing-prebuilds.md

Co-authored-by: Laura Coursen <lecoursen@github.com>

* Update content/codespaces/prebuilding-your-codespaces/managing-prebuilds.md

Co-authored-by: Laura Coursen <lecoursen@github.com>

* Update content/codespaces/prebuilding-your-codespaces/managing-prebuilds.md

Co-authored-by: Laura Coursen <lecoursen@github.com>

* Update content/codespaces/prebuilding-your-codespaces/managing-prebuilds.md

Co-authored-by: Laura Coursen <lecoursen@github.com>

* Update content/codespaces/prebuilding-your-codespaces/managing-prebuilds.md

Co-authored-by: Laura Coursen <lecoursen@github.com>

* Update content/codespaces/prebuilding-your-codespaces/managing-prebuilds.md

Co-authored-by: Laura Coursen <lecoursen@github.com>

* Update content/codespaces/prebuilding-your-codespaces/managing-prebuilds.md

Co-authored-by: Laura Coursen <lecoursen@github.com>

* Update content/codespaces/prebuilding-your-codespaces/managing-prebuilds.md

Co-authored-by: Laura Coursen <lecoursen@github.com>

* Update content/codespaces/prebuilding-your-codespaces/managing-prebuilds.md

* Update content/codespaces/prebuilding-your-codespaces/managing-prebuilds.md

Co-authored-by: Laura Coursen <lecoursen@github.com>

* Update content/codespaces/prebuilding-your-codespaces/managing-prebuilds.md

Co-authored-by: Laura Coursen <lecoursen@github.com>

* Update content/codespaces/prebuilding-your-codespaces/managing-prebuilds.md

Co-authored-by: Laura Coursen <lecoursen@github.com>

* Update data/reusables/codespaces/billing-for-prebuilds.md

* Update data/reusables/codespaces/billing-for-prebuilds.md

Co-authored-by: Laura Coursen <lecoursen@github.com>

* Move deletion points, as per review comment

* Update link

* Add links to new information

* Make review comment changes

* Update content/codespaces/prebuilding-your-codespaces/managing-prebuilds.md

Co-authored-by: Jackie Jiménez <jaclynj@github.com>

* Update content/codespaces/prebuilding-your-codespaces/testing-dev-container-changes.md

* Update content/codespaces/prebuilding-your-codespaces/testing-dev-container-changes.md

Co-authored-by: Jackie Jiménez <jaclynj@github.com>

* Optimize images

Co-authored-by: Mark Battistella <markbattistella@users.noreply.github.com>
Co-authored-by: Emily Grace Seville <emilyseville7cf@gmail.com>
Co-authored-by: Octomerger Bot <63058869+Octomerger@users.noreply.github.com>
Co-authored-by: Anders Starcke Henriksen <starcke@github.com>
Co-authored-by: Peter Bengtsson <mail@peterbe.com>
Co-authored-by: Laura Coursen <lecoursen@github.com>
Co-authored-by: lucie-docs <40564413+lucie-docs@users.noreply.github.com>
Co-authored-by: Josh Johanning <joshjohanning@github.com>
Co-authored-by: Tahlia G <84726379+tahlialouisa@users.noreply.github.com>
Co-authored-by: Ethan Palm <56270045+ethanpalm@users.noreply.github.com>
Co-authored-by: Felicity Chapman <felicitymay@github.com>
Co-authored-by: GitHub Actions <action@github.com>
Co-authored-by: docubot <67483024+docubot@users.noreply.github.com>
Co-authored-by: Simon Giesemann <kwacky1@github.com>
Co-authored-by: Robert Sese <rsese@github.com>
Co-authored-by: Mike Surowiec <mikesurowiec@users.noreply.github.com>
Co-authored-by: Albin PK <56157868+albinpk@users.noreply.github.com>
Co-authored-by: Dasun Tharanga <dasuntharangaflash@gmail.com>
Co-authored-by: github-openapi-bot <69533958+github-openapi-bot@users.noreply.github.com>
Co-authored-by: Ramya Parimi <33761166+ramyaparimi@users.noreply.github.com>
Co-authored-by: github-openapi-bot <github-openapi-bot@users.noreply.github.com>
Co-authored-by: Matt Pollard <mattpollard@users.noreply.github.com>
Co-authored-by: Dorothy Mitchell <dorothymitchell@github.com>
Co-authored-by: Andy J <mumfy@github.com>
Co-authored-by: mc <42146119+mchammer01@users.noreply.github.com>
Co-authored-by: Marko Kaznovac <kaznovac@users.noreply.github.com>
Co-authored-by: Anil Seervi <61609033+AnilSeervi@users.noreply.github.com>
Co-authored-by: Johanan Idicula <johanan@forcepush.tech>
Co-authored-by: Jackie Jiménez <jaclynj@github.com>
Co-authored-by: github-actions <github-actions@github.com>
2022-02-23 17:52:53 +00:00

7.2 KiB

title, intro, product, permissions, redirect_from, versions, type, topics, shortTitle
title intro product permissions redirect_from versions type topics shortTitle
Creating a codespace You can create a codespace for a branch in a repository to develop online. {% data reusables.gated-features.codespaces %} {% data reusables.codespaces.availability %}
/github/developing-online-with-github-codespaces/creating-a-codespace
/github/developing-online-with-codespaces/creating-a-codespace
fpt ghec
* *
how_to
Codespaces
Fundamentals
Developer
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 %}

Codespaces are associated with a specific branch of a repository and the repository cannot be empty. {% data reusables.codespaces.concurrent-codespace-limit %} For more information, see "Deleting a codespace."

When you create a codespace, a number of steps happen to create and connect you to your development environment:

  • Step 1: VM and storage are assigned to your codespace.
  • Step 2: Container is created and your repository is cloned.
  • Step 3: You can connect to the codespace.
  • Step 4: Codespace continues with post-creation setup.

For more information on what happens when you create a codespace, see "Deep Dive."

For more information on the lifecycle of a codespace, see "Codespaces lifecycle."

If you want to use Git hooks for your codespace, then you should set up hooks using the devcontainer.json lifecycle scripts, such as postCreateCommand, during step 4. Since your codespace container is created after the repository is cloned, any git template directory configured in the container image will not apply to your codespace. Hooks must instead be installed after the codespace is created. For more information on using postCreateCommand, see the devcontainer.json reference in the Visual Studio Code documentation.

{% data reusables.codespaces.use-visual-studio-features %}

{% data reusables.codespaces.you-can-see-all-your-codespaces %}

{% data reusables.codespaces.prebuilds-crossreference %}

Access to {% data variables.product.prodname_codespaces %}

{% data reusables.codespaces.availability %}

When you have access to {% data variables.product.prodname_codespaces %}, you'll see a "Codespaces" tab within the {% octicon "code" aria-label="The code icon" %} Code drop-down menu when you view a repository.

You'll have access to codespaces under the following conditions:

  • You are a member of an organization that has enabled {% data variables.product.prodname_codespaces %} and set a spending limit.
  • An organization owner has granted you access to {% data variables.product.prodname_codespaces %}.
  • The repository is owned by the organization that has enabled {% data variables.product.prodname_codespaces %}.

{% note %}

Note: Individuals who have already joined the beta with their personal {% data variables.product.prodname_dotcom %} account will not lose access to {% data variables.product.prodname_codespaces %}, however {% data variables.product.prodname_codespaces %} for individuals will continue to remain in beta.

{% endnote %}

Organization owners can allow all members of the organization to create codespaces, limit codespace creation to selected organization members, or disable codespace creation. For more information about managing access to codespaces within your organization, see "Enable Codespaces for users in your organization."

Before {% data variables.product.prodname_codespaces %} can be used in an organization, an owner or billing manager must have set a spending limit. For more information, see "About spending limits for Codespaces."

If you would like to create a codespace for a repository owned by your personal account or another user, and you have permission to create repositories in an organization that has enabled {% data variables.product.prodname_codespaces %}, you can fork user-owned repositories to that organization and then create a codespace for the fork.

Creating a codespace

{% webui %}

{% data reusables.repositories.navigate-to-repo %} 2. Under the repository name, use the "Branch" drop-down menu, and select the branch you want to create a codespace for.

Branch drop-down menu

  1. Under the repository name, use the {% octicon "code" aria-label="The code icon" %} Code drop-down menu, and in the Codespaces tab, click {% octicon "plus" aria-label="The plus icon" %} New codespace.

    New codespace button

    If you are a member of an organization and are creating a codespace on a repository owned by that organization, you can select the option of a different machine type. From the dialog box, choose a machine type and then click Create codespace.

    Machine type choice

    {% data reusables.codespaces.codespaces-machine-type-availability %}

{% endwebui %}

{% vscode %}

{% data reusables.codespaces.creating-a-codespace-in-vscode %}

{% endvscode %}

{% cli %}

{% data reusables.cli.cli-learn-more %}

To create a new codespace, use the gh codespace create subcommand.

gh codespace create 

You are prompted to choose a repository, a branch, and a machine type (if more than one is available).

Alternatively, you can use flags to specify some or all of the options:

gh codespace create -r <em>owner</em>/<em>repo</em> -b <em>branch</em> -m <em>machine-type</em> 

Replace owner/repo with the repository identifier. Replace branch with the name of the branch, or the full SHA hash of the commit, that you want to be initially checked out in the codespace. If you use the -r flag without the b flag, the codespace is created from the default branch.

Replace machine-type with a valid identifier for an available machine type. Identifiers are strings such as: basicLinux32gb and standardLinux32gb. The type of machines that are available depends on the repository, your user account, and your location. If you enter an invalid or unavailable machine type, the available types are shown in the error message. If you omit this flag and more than one machine type is available you will be prompted to choose one from a list.

For more information about this command, see the {% data variables.product.prodname_cli %} manual.

{% endcli %}