Skip to main content

Setting your timeout period for GitHub Codespaces

You can set your default timeout for GitHub Codespaces in your personal settings page.

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

A codespace will stop running after a period of inactivity. You can specify the length of this timeout period. The updated setting will apply to any newly created codespace.

Some organizations may have a maximum idle timeout policy. If an organization policy sets a maximum timeout which is less than the default timeout you have set, the organization's timeout will be used instead of your setting, and you will be notified of this after the codespace is created. For more information, see "Restricting the idle timeout period."

Warning: Codespaces are billed per minute. If you are not actively using a codespace but the codespace has not yet timed out, you are still billed for the time that the codespace is running. For more information, see "About billing for GitHub Codespaces."

Setting your default timeout period

  1. 在任何页面的右上角,单击个人资料照片,然后单击“设置”。

    用户栏中的 Settings 图标

  2. 在边栏的“代码、规划和自动化”部分中,单击“ Codespaces”。

  3. Under "Default idle timeout", enter the time that you want, then click Save. The time must be between 5 minutes and 240 minutes (4 hours). Selecting your timeout

Setting the timeout period for a codespace

若要详细了解 GitHub CLI,请参阅“关于 GitHub CLI”。

To set the timeout period when you create a codespace, use the idle-timeout argument with the codespace create subcommand. Specify the time in minutes, followed by m. The time must be between 5 minutes and 240 minutes (4 hours).

gh codespace create --idle-timeout 90m

If you don't specify a timeout period when you create a codespace, then the default timeout period will be used. For information about setting a default timeout period, click the "Web browser" tab on this page. You can't currently specify a default timeout period through GitHub CLI.

Setting a timeout period

You can set your default timeout period in your web browser, on GitHub.com. Alternatively, if you use GitHub CLI to create a codespace you can set a timeout period for that particular codespace. For more information, click the appropriate tab above.