Skip to main content

GitHub Codespaces overview

This guide introduces GitHub Codespaces and provides details on how it works and how to use it.

What is a codespace?

A codespace is a development environment that's hosted in the cloud. You can customize your project for GitHub Codespaces by committing configuration files to your repository (often known as Configuration-as-Code), which creates a repeatable codespace configuration for all users of your project.

Each codespace runs on a virtual machine hosted by GitHub. You can choose the type of machine you want to use, depending on the resources you need. Various types of machine are available, starting with a 2-core processor, 4 GB of RAM, and 32 GB of storage.

You can connect to your codespaces from your browser, from Visual Studio Code, from the JetBrains Gateway application, or by using GitHub CLI.

A diagram showing how GitHub Codespaces works

Using GitHub Codespaces

To begin developing using cloud-based compute resources, you can create a codespace from a template or from any branch or commit in a repository. When you create a codespace from a template, you can start from a blank template or choose a template suitable for the work you're doing.

Чтобы приступить к работе с GitHub Codespaces, см. статью Краткое руководство по GitHub Codespaces. Дополнительные сведения о создании codespace см. в разделах Создание codespace для репозитория или Создание codespace на основе шаблона. Если вы хотите вернуться к уже созданному codespace, см. раздел Открытие существующего пространства кода. Дополнительные сведения о работе GitHub Codespaces см. в разделе Подробное изучение GitHub Codespaces.

Using codespaces owned by your personal account

All personal GitHub.com accounts have a monthly quota of free use of GitHub Codespaces included in the Free or Pro plan. You can get started using GitHub Codespaces on your personal account without changing any settings or providing payment details.

You can create and use a codespace for any repository you can clone. You can also use a template to create codespaces that are not initially associated with a repository. If you create a codespace from an organization-owned repository, use of the codespace will either be charged to the organization (if the organization is configured for this), or to your personal account. Codespaces created from templates are always charged to your personal account.

Вы можете продолжать использовать GitHub Codespaces помимо ежемесячного использования хранилища и вычислений, предоставив сведения об оплате и установив предельную сумму расходов. Дополнительные сведения см. в статье Сведения о выставлении счетов за GitHub Codespaces.

Using organization-owned codespaces

Organization owners can enable use of GitHub Codespaces, billable to the organization or enterprise account. This applies to codespaces created from repositories owned by the organization. For more information, see "Enabling GitHub Codespaces for your organization." You can set a spending limit for use of GitHub Codespaces on your organization or enterprise account. For more information, see "Managing spending limits for GitHub Codespaces."

If use of a codespace will be billed to an organization or enterprise, this is shown when the codespace is created. For more information, see "Creating a codespace for a repository." Codespaces that are billed to an organization, or its parent enterprise, are owned by the organization and can be deleted by an organization owner. For more information, see "Deleting a codespace."

Customizing GitHub Codespaces

To customize the runtimes and tools in your codespace, you can create one or more dev container configurations for your repository. Adding dev container configurations to your repository allows you to define a choice of different development environments that are appropriate for the work people will do in your repository.

If you create a codespace from a repository without any dev container configurations, GitHub Codespaces will clone your repository into an environment with the default codespace image that includes many tools, languages, and runtime environments. If you create a codespace from a template, you might start with some initial configuration on top of the default image. For more information, see "Introduction to dev containers."

You can personalize aspects of your codespace environment by using a public dotfiles 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 GitHub Codespaces in the browser, or in Visual Studio Code, you can use 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 Visual Studio Code.

For more information, see "Customizing your codespace".

Billing for Codespaces

For information on pricing, storage, and usage for GitHub Codespaces, see "About billing for GitHub Codespaces."

Примечание: Перед выставлением счетов за использование GitHub Codespaces необходимо установить ненулевую предельную сумму расходов на личную, корпоративную или корпоративную учетную запись.

По умолчанию для всех учетных записей установлена предельная сумма расходов на GitHub Codespaces в размере 0 долл. США. Это предотвратит создание новых codespace или открытие существующих codespace, если это приведет к оплачиваемой стоимости вашей личной, корпоративной или корпоративной учетной записи. Для личных учетных записей всегда можно создать и использовать codespace, если учетная запись не достигла предела ежемесячного использования. Для организаций и предприятий предельная сумма расходов по умолчанию означает, что, чтобы разрешить пользователям создавать codespace, которые выставляются организации или ее родительскому предприятию, ограничение должно быть изменено на значение выше 0 долл. США.

Costs for GitHub Codespaces are always billed monthly, even if your account is otherwise billed annually. For information on how organizations owners and billing managers can manage the spending limit for GitHub Codespaces for an organization, see "Managing spending limits for GitHub Codespaces."