135.1 What is version control?

Understand the purpose of version control and how it supports reliable software development through tracking, saving, and managing changes.

What is version control?

Version control is a system that records changes to files over time, allowing developers to retrieve specific versions later. In software development, it enables teams to track edits, recover earlier versions of code, and work on different features simultaneously without overwriting each other’s work.

Think of version control as a “save game” system for your project. At any point, you can return to a previous snapshot if something breaks—or compare changes to see what has been improved.

Why developers use version control

Professional developers and teams use version control systems (VCS) like Git for several important reasons:

  • Tracking changes Every change is recorded, along with the name of the person who made it and the reason for the change.

  • Undoing mistakes If something breaks, you can roll back to a previous working version.

  • Team collaboration Multiple people can work on the same project at once without interfering with each other’s code.

  • Experimentation Developers can try new ideas in isolated branches without affecting the main code.

Without version control, it’s common to see files like app_v2_FINAL_final_revised_3.py, which is both confusing and risky.

Local vs remote version control

There are two key parts to modern version control:

  • Local version control (e.g. Git on your computer) Tracks your code history and stores it on your machine.

  • Remote version control (e.g. GitHub) Stores your project online, allowing it to be shared, backed up, and collaboratively edited.

You make changes locally, then push those changes to a shared online repository. Others can pull the latest version, make their edits, and contribute through branches or pull requests.

How version control works: a simple workflow

Here’s a typical flow when using Git and GitHub:

  1. Edit code – Make a change to a file in your project.

  2. Stage changes – Use git add to tell Git which files to track.

  3. Commit changes – Save a snapshot with a message using git commit -m "message".

  4. Push to remote – Use git push to upload the snapshot to GitHub.

  5. Collaborate – Other developers pull the changes and continue the cycle.

Each commit becomes part of the project history. Over time, this creates a complete record of how the software evolved.

Analogy: The Undo History

Imagine if every change you made in a Word document was recorded automatically, with a comment saying why you made it. You could scroll back through any version, compare different drafts, and even merge edits from different people. That’s version control—but for code.

Key concepts

  • A repository (repo) is a folder that Git watches. It stores your project’s files and history.

  • A commit is a saved snapshot of your changes, like a milestone.

  • A branch is a parallel version of your codebase, often used to test or add features.

  • Merging brings different branches together, integrating changes.

  • GitHub hosts your repository online, making it shareable and collaborative.

Summary

Version control is essential in modern software engineering. It enables reliable, trackable, and collaborative development by recording each change to your project over time. Git handles version tracking locally, while GitHub lets you share and collaborate remotely.

In the following sections, we’ll look at how Git and GitHub work together and how you can interact with both using your IDE or command line.

Last updated

Was this helpful?