Skip to main content

Using GitHub Codespaces with GitHub Classroom

You can use Acerca de GitHub Codespaces as the preferred editor in your assignments to give students access to a browser-based Visual Studio Code environment with one-click setup.

Organization owners who are admins for a classroom can enable Acerca de GitHub Codespaces for their organization and integrate Acerca de GitHub Codespaces as the supported editor for an assignment. Para obtener más información sobre los administradores de las aulas, consulta la sección "Acerca de la administración de aulas".

Codespaces is available to use with GitHub Classroom for organizations that use GitHub Team. To find out if you qualify for a free upgrade to GitHub Team, see "Apply for an educator or researcher discount."

Acerca de Codespaces

Acerca de GitHub Codespaces es un ambiente de desarrollo basado en la nube e instantáneo que utiliza un contenedor para proporcionarte lenguajes comunes, herramientas y utilidades para el desarrollo. Codespaces is also configurable, allowing you to create a customized development environment that is the same for all users of your project. For more information, see "Acerca de GitHub Codespaces overview."

Once Codespaces is enabled in an organization or enterprise, users can create a codespace from any branch or commit in an organization or enterprise repository and begin developing using cloud-based compute resources. You can connect to a codespace from the browser or locally using Visual Studio Code. Para iniciar con los Codespaces, consulta la "Guía rápida para Codespaces". Para aprender más sobre cómo funcionan los Codespaces, consulta la sección "Adentrarse en los codespaces".

Setting Codespaces as the preferred editor for an assignment in GitHub Classroom assignments, is beneficial for both students and teachers. Codespaces is a good option for students using loaned devices or without access to a local IDE setup, since each codespace is cloud-based and requires no local setup. Students can launch a codespace for an assignment repository in Visual Studio Code directly in their browser, and begin developing right away without needing any further configuration.

For assignments with complex setup environments, teachers can customize the dev container configuration for a repository's codespaces. This ensures that when a student creates a codespace, it automatically opens with the development environment configured by the teacher. Para obtener más información sobre los contenedores dev, consulta la sección "introducción a los contenedores dev".

About the Codespaces Education benefit for verified teachers

The Codespaces Education benefit gives verified teachers a free monthly allowance of Codespaces hours to use in GitHub Classroom. The free allowance is estimated to be enough for a class of 50 with 5 assignments per month, on a 2 core machine with 1 codespace stored per student.

Note: The Codespaces Education benefit is currently in public beta and subject to change. During the beta release, your organization will not be charged if you exceed the free allowance.

To become a verified teacher, you need to be approved for an educator or teacher benefit. For more information, see "Applying for an educator or teacher benefit."

After you have confirmation that you are a verified teacher, visit GitHub Global Campus for Teachers to upgrade the organization to GitHub Team. For more information, see GitHub's products.

If you are eligible for the Codespaces Education benefit, when you enable Codespaces in GitHub Classroom for your organization, GitHub automatically adds a Codespace policy to restrict machine types for all codespaces in the organization to 2 core machines. This helps you make the most of the free Codespaces usage. However, you can change or remove these policies in your organization settings. Para obtener más información, consulta la sección "Restringir el acceso a los tipos de máquina".

When the Codespaces Education benefit moves out of beta, if your organization exceeds their free allowance for Codespaces usage, your organization will be billed for additional usage. Para obtener más información, consulta la sección "Acerca de la facturación para el Codespaces".

Habilitar los Codespaces para tu organización

Codespaces is available to use with GitHub Classroom for organizations that use GitHub Team. If you are eligible for the Codespaces Education benefit, you must enable Codespaces through GitHub Classroom, instead of enabling it directly in your organization settings. Otherwise, your organization will be billed directly for all usage of Codespaces.

Enabling Codespaces for an organization when creating a new classroom

  1. Inicia sesión en GitHub Classroom.

  2. Da clic en Aula nueva.

    Botón de "Aula nueva"

  3. En la lista de organizaciones, da clic en aquella que te gustaría utilizar para tu aula. Organizations that are eligible for Codespaces will have a note showing that they are eligible. Opcionalmente, puedes crear una organizción nueva. Para obtener más información, consulta la sección "Crear una organización nueva desde cero".

    Choose organization for classroom with codespaces eligibility

  4. In the "Name your classroom" page, under "Codespaces in your Classroom", click Enable. Note that this will enable Codespaces for all repositories and users in the organization.

    Enable Codespaces for org in "Setup classroom basics" page

  5. When you are ready to create the new classroom, click Create classroom.

Enabling Codespaces for an organization via an existing classroom

  1. Inicia sesión en GitHub Classroom.

  2. En la lista de aulas, da clic en aquella que quieras ver. Aula en la lista de aulas de una organización

  3. Debajo del nombre del aula, da clic en Configuración. Pestaña de "Configuración" del aula

  4. Under "Acerca de GitHub Codespaces", click Enable. This will enable Codespaces for all repositories and users in the organization. A new Codespace policy is also added to restrict machine types for all codespaces in the organization to 2 core machines.

    Enable Codespaces for org in existing classroom settings

You can use the same methods as above to disable Codespaces for your organization as well. Note that this will disable Codespaces for all users and repositories in the organization.

Configuring an assignment to use Codespaces

To make Codespaces available to students for an assignment, you can choose Codespaces as the supported editor for the assignment. When creating a new assignment, in the "Add your starter code and choose your optional online IDE" page, under "Add a supported editor", select Acerca de GitHub Codespaces from the dropdown menu.

Select Codespaces as supported editor for assignment

If you use a template repository for an assignment, you can define a dev container in the repository to customize the tools and runtimes available to students when they launch a codespace to work on the assignment. If you do not define a dev container, Acerca de GitHub Codespaces will use a default configuration, which contains many of the common tools that your students might need for development. For more information on defining a dev container, see "Add a dev container configuration to your repository."

Launching an assignment using Codespaces

When a student opens an assignment, the repository's README file includes their teacher's recommendation of the IDE they should use for the work.

Screenshot of the Codespaces note in the README for a student assignment repository

Students can launch a new or existing codespace by clicking the Code button on the main page of the assignment repository, then selecting the Codespaces tab. Para obtener más información, consulta la sección "Crear un codespace".

Launch new codespace in assignment repository

Teachers can view each student's codespace for an assignment in the assignment overview page. You can click on the Codespaces icon on the right side of each student row to launch the codespace.

Teacher assignment overview with student's codespaces

When you connect to a codespace through a browser, auto-save is enabled automatically. If you want to save changes to the repository, you will need to commit the changes and push them to a remote branch. If you leave your codespace running without interaction for 30 minutes by default, the codespace will timeout and stop running. Your data will be preserved from the last time you made a change. Para obtener más información sobre el ciclo de vida de los codespaces, consulta la sección "Ciclo de vida de los codespaces".