Exercise - Code with Codespaces and Visual Studio Code
In this lab, you will learn to use GitHub Codespaces with Visual Studio Code to develop and run code in a cloud-based development environment. GitHub Codespaces provides a complete, configurable dev environment that runs in the cloud, allowing you to code from anywhere without setting up a local development environment.
You will learn how to:
- Create and configure a GitHub Codespace
- Use Visual Studio Code in the browser
- Develop and run code in Codespaces
- Manage and customize your development environment
- Understand the benefits of cloud-based development
This lab takes approximately 30-45 minutes to complete.
Before you start
To complete the lab, you need:
- A GitHub user account. If you don't have one, you can create a new account. If you need instructions on how to create a GitHub account, refer to the article Creating an account on GitHub.
- A web browser with access to the internet.
- Basic understanding of coding and using an IDE (helpful but not required).
Complete the exercise on GitHub
In this exercise, you'll learn to create and use GitHub Codespaces through a hands-on GitHub Skills exercise.
Note: This exercise is hosted on GitHub Skills and provides an interactive learning experience. You'll create a Codespace, make code changes, and understand how to work in a cloud-based development environment.
The exercise consists of the following activities:
-
Start a web browser and navigate to the exercise repository: https://github.com/skills-dev/code-with-codespaces
-
On the exercise page, select the Use this template button to copy the exercise to your GitHub account.
Note: Simply copy the exercise to your account, then give GitHub about 20 seconds to prepare the first lesson, then refresh the page.
-
Follow the instructions on the repository's README to complete all the challenges, which include:
- Creating a Codespace for your repository
- Exploring the Codespace interface and understanding its features
- Making code changes in the Visual Studio Code editor
- Running and testing code in the integrated terminal
- Committing and pushing changes from your Codespace
- Managing your Codespaces and understanding resource usage
-
Work through each step in the exercise, following the prompts and instructions provided.
Note: Codespaces provides a full-featured development environment with extensions, terminal access, and debugging capabilities.
-
When you finish all the challenges, you'll understand how to use Codespaces for your development workflow.
What you've learned
After completing this exercise, you should be able to:
- Create and launch GitHub Codespaces
- Use Visual Studio Code in the browser
- Develop code in a cloud-based environment
- Customize your Codespace configuration
- Understand when to use Codespaces vs local development
- Manage your Codespace resources
- Integrate Codespaces into your development workflow
Congratulations! You've completed the "Code with Codespaces and Visual Studio Code" exercise and learned how to develop in the cloud!