Skip to content

How to use GitHub Codespaces

Sami Atoui edited this page Mar 24, 2023 · 5 revisions

GitHub Codespaces

What is GitHub Codespaces?

GitHub Codespaces is a cloud-based development environment that allows developers to write, run, and debug code entirely within their web browser. Essentially, it enables developers to create and customize a development environment that is hosted entirely on GitHub.

  • Allows developers to switch easily between different projects and environments without having to set up their own local development environment.
  • Allows for easy collaboration between developers.
  • Seamless integration with GitHub's existing tools such as GitHub actions, and also enables developers to easily set up continuous integration and deployment pipelines for their projects.

You can find the GitHub Codespaces docs here.

What are the constraints?

GitHub Codespaces provides each account with 15 GB monthly storage and 120 core hours usage per month for free. That being said, use the provided resources efficiently to avoid running out before the month resets.

A stable and reliable internet connection is also required at all times as this is a cloud-based environment.

Getting Started

1. Head to the repository you wish to work on.

image

2. Once you are on the page of the repository, look for the blue button labeled '<> Code'

image

3. Click on the prompt to Create Codespace on main (here it is referring to the branch that you are on)

image

4. You will then find yourself in a browser version of VSCode.

image

5. At this point you may use the terminal to 'npm install' your packages and run your application or edit the codebase in the explorer.

Configuration

You may configure preferences to your liking by accessing the settings. In this section, you can set timeout limits for your codespace which can help save you usage hours while not actively working on your codespace. You can also choose a different web editor instead of VSCode.

Dev containers

What are dev containers?

Dev/Development containers are Docker containers that you can configure for a tailored dev environment.

You can find the Dev containers docs here.

Groups using Codespaces

Clone this wiki locally