Link Search Menu Expand Document

Git, GitHub, and Codespaces

People use GitHub to build some of the most advanced technologies in the world. Whether you’re visualizing data or building a new game, there’s a whole community and set of tools on GitHub that can help you do it even better.


What is Version Control?

A version control system (VCS) is a tool that tracks and manages changes to files over time. This system allows you to:

  • Save snapshots (called “commits”) of your project at any point.
  • Restore previous versions if you make a mistake.
  • Compare changes between different versions to identify differences.
  • Collaborate with other people on the same project without overwriting each other’s work.

In this section, we’ll learn about Git, the world’s most popular VCS, and GitHub, its most popular hosting service.


Git vs. GitHub: What’s the Difference?

First and foremost, Git and GitHub are not the same thing.

  • Git is the software—a distributed version control system that runs on your local machine. It’s the core tool you use to track changes and save your project’s history. Developers use Git through the command line (terminal) or with graphical (GUI) applications.

  • GitHub is a web-based service—a hosting platform for Git repositories. It provides a central, “remote” place online to store your project, share it, and collaborate with others.

The way Git works is by creating a repository (a project folder and its hidden .git directory) to store your project. As you work, you “commit” your changes, which tells Git to save a snapshot of the project’s current state.


What is GitHub Codespaces?

GitHub Codespaces is a feature of GitHub that provides a complete development environment hosted in the cloud. Think of it as your entire workstation—including a code editor (VS Code), a terminal, and all your project’s files—accessible directly from your web browser.

Instead of setting up a project on your local machine, Codespaces creates a “codespace” for any repository. This means you can start coding instantly without worrying about installing software, managing dependencies, or configuring your computer. It’s a powerful way to work on projects from anywhere, on any device.


How They Work Together: Local vs. Cloud

Git, GitHub, and Codespaces work together to create a flexible workflow for tracking and sharing code. There are two primary ways to work:

1. The Traditional Local Workflow

Git, by itself, manages your project’s history on your local machine. This is the classic workflow:

  1. You “clone” (download) a remote repository from GitHub to your computer.
  2. You use Git on your local machine to make changes and “commit” (save) them.
  3. You then “push” those new commits up to the central repository on GitHub to share them.
  4. Your teammates can then “pull” those changes down to their own local computers.

This process is the standard for team collaboration but requires every developer to set up their own local environment.

2. The Cloud-Based Workflow (GitHub Codespaces)

GitHub Codespaces simplifies this process by moving your entire development environment into the cloud.

  1. Instead of cloning to your local machine, you create a codespace directly on GitHub.
  2. This launches a cloud-based editor in your browser with your project’s files already loaded.
  3. You can edit code, use the terminal, and commit your changes using the integrated Git tools—all from within the codespace.
  4. When you push your changes, they are sent directly to the GitHub repository, with no local setup required.

Table of contents


^
TOP

Copyright @ 2025 CityU STC