Skip to main content

Developing in a codespace

You can open a codespace on GitHub Enterprise Cloud, then develop using Visual Studio Code's features.

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

About development with GitHub Codespaces

GitHub Codespaces provides you with the full development experience of Visual Studio Code. 使用 VS Code 在 codespace 中开发时,你可以编辑代码、调试和使用 Git 命令。 有关详细信息,请参阅 VS Code 文档

To get started with GitHub Codespaces, see "Quickstart for GitHub Codespaces." For more information on creating or reopening a codespace, see "Creating a codespace" and "Opening an existing codespace." To learn more about how GitHub Codespaces works, see "Deep dive into GitHub Codespaces."

Codespace overview with annotations

  1. Side Bar - By default, this area shows your project files in the Explorer.
  2. Activity Bar - This displays the Views and provides you with a way to switch between them. You can reorder the Views by dragging and dropping them.
  3. Editor - This is where you edit your files. You can use the tab for each editor to position it exactly where you need it.
  4. Panels - This is where you can see output and debug information, as well as the default place for the integrated Terminal.
  5. Status Bar - This area provides you with useful information about your codespace and project. For example, the branch name, configured ports, and more.

For more information on using VS Code, see the User Interface guide in the VS Code documentation.

可以直接从 VS Code 连接到你的 codespace。 有关详细信息,请参阅“在 VS Code 中使用 codespace”。

For the best experience with GitHub Codespaces, we recommend using a Chromium-based browser, like Google Chrome or Microsoft Edge. For more information, see "Troubleshooting GitHub Codespaces clients."

Personalizing your codespace

还可以使用 dotfiles 存储库和设置同步为创建的任何 codespace 个性化 codespace 环境的各个方面。 个性化可以包括 shell 首选项和其他工具。 For more information, see "Personalizing GitHub Codespaces for your account."

在存储库的 GitHub Codespaces 配置更改后,你可以通过重新生成 codespace 的容器来将更改应用于现有 codespace。 For more information, see "Introduction to dev containers."

Running your app from a codespace

您可以转发代码空间中的端口以测试和调试应用程序。 还可以管理端口协议,并在组织内或公开共享端口。 For more information, see "Forwarding ports in your codespace."

Committing your changes

在对代码空间进行更改(无论是添加新代码还是更改配置)之后,您需要提交更改。 将更改提交到仓库可确保从此仓库创建代码空间的其他任何人都具有相同的配置。 这也意味着你所做的任何自定义,例如添加 VS Code 扩展,都会显示给所有用户。

有关详细信息,请参阅“在 codespace 中使用源代码管理”。

Using the Visual Studio Code Command Palette

The Visual Studio Code Command Palette allows you to access and manage many features for GitHub Codespaces and VS Code. For more information, see "Using the VS Code Command Palette in GitHub Codespaces."