Skip to main content

Enabling GitHub Codespaces for your organization

You can control which users in your organization can use GitHub Codespaces at the organization's expense.

Who can use this feature

To alter an organization's billing settings, you must be an organization owner.

GitHub Codespaces 可用于使用 GitHub Team 或 GitHub Enterprise Cloud 的组织。 GitHub Codespaces 也可作为受限的 beta 版本提供给使用 GitHub Free 和 GitHub Pro 计划的个人用户。 有关详细信息,请参阅“GitHub 的产品”。

About enabling GitHub Codespaces for your organization

Organization owners can control which users in your organization can create and use codespaces at the organization's expense.

Only people who can clone a repository can create a codespace for that repository. To allow people to create codespaces for repositories owned by your organization, you must:

To allow people to create codespaces for which your organization will be billed, you must:

Note: If you are a verified educator or a teacher, you must enable Codespaces from a GitHub Classroom to use your Codespaces Education benefit. For more information, see "Using GitHub Codespaces with GitHub Classroom."

By default, a codespace can only access the repository from which it was created. If you want codespaces in your organization to be able to access other organization repositories that the codespace creator can access, see "Managing repository access for your organization's codespaces."

Choose who can create codespaces that are billed to your organization

  1. 在 GitHub.com 的右上角,单击你的个人资料照片,然后单击“你的组织”。 贵组织在配置文件菜单中

  2. 在组织旁边,单击“设置”。 设置按钮

  3. 在左侧栏中,单击“ 代码空间”。

  4. Under "Billing," select one of the following options:

    • Disabled - Your organization will not be charged for codespace usage. Codespaces created for your organization's repositories will be billed to the individual users who create them.
    • Selected members - Codespaces created for your organization's repositories by selected members will be billed to the organization.
    • All members - Codespaces created for your organization's repositories by members of your organization will be billed to the organization.
    • All members and outside collaborators - Codespaces created for your organization's repositories by organization members and outside collaborators will be billed to the organization.

    Radio buttons for "Billing"

    Note: When you select All members and outside collaborators, all outside collaborators who have been added to specific repositories can create and use Codespaces for those repositories, and your organization will be billed for this usage. For more information on managing outside collaborators, see "About outside collaborators."

  5. Click Save.

  6. If you chose Selected members, an input box is displayed for you to enter the names of users you want to select.

    Input box for selecting users

Disabling Codespaces for your organization

You can prevent the creation and use of codespaces billable to your organization.

注意:如果为组织禁用计费 codespace 使用,则可以作为个人用户创建 codespace,并且可以克隆组织中的存储库的任何人都可以为该存储库创建 codespace。 但是,这不会对组织产生任何费用。 有关限制存储库访问的信息,请参阅“管理有权访问存储库的团队和人员”。

  1. 在 GitHub.com 的右上角,单击你的个人资料照片,然后单击“你的组织”。 贵组织在配置文件菜单中
  2. 在组织旁边,单击“设置”。 设置按钮
  3. 在左侧栏中,单击“ 代码空间”。
  4. Under "Billing," select Disabled.

Setting a spending limit

Note: You must set a non-zero spending limit before you can use GitHub Codespaces.

By default, your organization or enterprise will have a GitHub Codespaces spending limit of $0. This prevents new codespaces from being created, or existing codespaces from being opened, if this would incur a billable cost to your organization or enterprise. To allow your users to create codespaces in your organization, set the limit to a value higher than $0.

超额始终按月计费,并不以你的计费期限为准(即使你的帐户按年计费)。

For information on managing and changing your account's spending limit, see "Managing your spending limit for Codespaces."