Introduction to Version Control

16th January, 2021

Motivation

Back in school, some friends and I worked on a C++ project — a replica of a Pizza Reservation system — in a single file, main.cpp. As we kept adding features and fixing bugs, we ended up saving it as "main_final_latest_version.cpp." On submission day, merging everything back together, we lost track of the changes — and we had no backup at all.

The simplest solution to that kind of problem: version control.

What is Version Control?

In software engineering, version control (also called revision control or source control) is a class of systems that manages changes to programs, documents, or other collections of information.

In plain terms: imagine you failed an exam and wished you had a time machine to go back and prepare only for the questions that actually showed up. That's what a Version Control System (VCS) gives you — the ability to travel back through a file's history.

Features of a VCS

Vocabulary worth knowing

Basic:

Advanced:

Centralized vs. Distributed

In centralized version control (e.g. Subversion), everyone has a working copy, but there's one central repository — as soon as you commit, others can update and see your changes.

In distributed version control (e.g. Git, Mercurial), everyone has their own full repository and working copy. For others to see your changes, four things need to happen: you commit, you push, they pull, and they update. Distributed won — that's what most teams use today.

← Back to all posts