Using GitHub Codespaces

Develop directly in the cloud without installing tools locally.

What Is GitHub Codespaces?

GitHub Codespaces is a cloud-based development environment that lets you write, edit, and run code directly in your browser using Visual Studio Code. Instead of installing compilers, interpreters, or frameworks on your computer, Codespaces provides a ready-to-use environment that mirrors a local setup. This makes it perfect for working on projects without needing to install anything locally.

Codespaces is especially useful for students, teams, and open-source contributors. It ensures that everyone works in the same environment, reducing compatibility issues and saving time on setup.

Creating a Codespace

Follow these steps to launch your first Codespace:

  1. Open your repository on GitHub.
  2. Click the green Code button.
Repository page showing Code button with options
The repository page includes a green Code button that opens options for cloning or creating a Codespace.
  1. Select the Codespaces tab.
  2. Click Create codespace on main.
  3. Wait a few moments while your environment loads in the browser.
Codespaces tab with option to create a new codespace
The Codespaces tab allows you to launch a new cloud‑based development environment directly from your repository.

Working Inside a Codespace

Once your Codespace is ready, you’ll see a familiar Visual Studio Code interface. Here are the key features:

This environment behaves almost exactly like a local VS Code setup, but everything runs in the cloud.

Saving and Committing Changes

Any changes you make in Codespaces can be committed and pushed directly to your GitHub repository:

  1. Open the Source Control panel.
  2. Review your changes and write a commit message.
  3. Click Commit and then Push to sync with GitHub.
Source Control panel in Codespaces showing staged changes and commit message field
The Source Control panel in Codespaces lets you stage changes, write commit messages, and push updates to GitHub.

This workflow ensures that your cloud‑based edits are tracked and versioned just like local changes.

Why Use Codespaces?

Continue to Version Control

Now that you’ve explored Codespaces, you’re ready to learn how to track changes with commits and branches. Visit the Version Control page to continue.