Codespaces and VS Code

Megumi Oshima & Nicholas Ducharme-Barth

January 2025

What is Codespaces?

  • Development environment that is hosted in the cloud on GitHub.com
  • You control the specs of the machine!
  • Connected to your repository

Why use it?

  • Containerized environment
  • Anyone using it is working in the same environment
    • Same OS
    • Same software
    • Same package versions

“It works on my computer!”

When should I use codespaces?

  • Workshops/Trainings
  • Reviews
  • Developing packages or software
  • Traveling
  • Can’t install certain software onto your computer

Set Up

To set up a Codespace,

  1. Create a .devcontainer folder inside your repository
  1. Add a devcontainer.json file to that folder
  1. Set up devcontainer.json how you like (packages, software, extensions, etc.)
  1. Add a setup.r file if needed

See the devcontainer.json we are using here

Spin up the Codespace

On the main page of the repository, “Code” -> “Create codespace on main”

Let’s build our codespaces!

VS Code

VS Code is a free IDE software used for writing and running code

Activity

  1. Create a new branch from the main branch

    git checkout -b new-branch-name

  2. Add your name to the list of participants in the README.md file.

  3. Save your change, commit, and push to your branch.

    git add README.md  
    git commit -m "add descriptive message here"  
    git push origin new-branch-name