Skip to main content

Github CodeSpaces

Github Codespaces provides a virtual machine (VM) within the browser. Using this VM, students can write, compile and run their programs. Github codespaces work with github repositories. Once a student has completed their tasks, they commit the code they wrote within a code space back into their assignment repositories. You can enable github codespaces for the organization you are using for your classroom, allowing students to run codespace for their assignments. However, your organization must be upgraded. This is where verification is really useful.

Spinning up a Code Space

  • To spin up a code space, use the <> code button within the code tab of the repository
    • Choose the code space tab
    • Hit the button that says "create code space on main"
    • Note that this button will change to the name of the vm after the first time.
    • Typically Chromium based browsers and firefox work well. If you are having trouble spinning up the code space, try a differnt browser.

Working within the code space

The default code space loads a visual studio code instance and clones your repository into that instance. The code spaces has a navigation panel on the left, editor tabs and terminal/console panes on the right. You can use this to edit your files, compile and run it.

Customization of code space for your students

You can enforce how a code space works for your students by using docker files (what languages, what tools, even automatic backup). This is more advance than I have set up but possibly worth looking into.