Pebellslearn by building
0%
RoadmapsMatrixCoursesSandboxSign in
Learn the Basics  ›  Lesson

What Version Control Is, and Why You Want It

What is Version Control? 12 minA version control system records snapshots of a project with who, when and why, so you can go back, compare, experiment and collaborate.

What Version Control Is, and Why You Want It

Asha keeps her favourite recipes in a folder called recipe-box. Last week she "improved" the pancake recipe, the pancakes came out flat, and now she cannot remember how much baking powder the old version used. Her folder only knows how things are now. Version control is the tool that remembers how things were.

The rule

Version control saves snapshots, so any past state is one step away.

A version control system (VCS) watches a folder of files and, whenever you ask, records a snapshot of all of them together. Each snapshot comes with:

  • who made it,
  • when it was made,
  • a message saying why.

The chain of snapshots is the project's history. With it, Asha can:

  • Go back: see the pancake recipe exactly as it was on Monday.
  • Compare: ask "what changed between Monday and today?" and see the one line where 2 tsp became 1 tsp.
  • Experiment safely: try a vegan version on the side without touching the working recipe.
  • Work with others: her brother can add recipes at the same time, and the tool combines both sets of changes.
  • Know why: every change carries a note, so "why is there salt in the chai?" has an answer.

Compare that with the manual method everyone starts with:

pancakes.md
pancakes-old.md
pancakes-final.md
pancakes-final-REALLY.md

Copies like these tell you nothing about what changed or why, they fill the folder with clutter, and they fall apart the moment two people edit at once.

Version control is not only for code. Anything made of text files — recipes, essays, configuration, documentation, website content — benefits in the same way.

The shortcut

When you meet any version control idea, ask "which snapshot, and what does it let me recover?" Every feature is really one of four verbs: record a snapshot, look back at one, compare two, or combine separate lines of work.

The flat-pancake mysteryStep 1 of 4
  1. Record

    Every time Asha finished an edit she recorded a snapshot with a message, such as "Use less sugar".

The trap is thinking of version control as a backup tool. A backup copies files; version control records meaningful steps with reasons, so you can understand a project, not only restore it.

Drills

Answer fast — trust the rule.

quick drill

What does a version control system record each time you ask it to?

quick drill

Which problem does version control NOT solve on its own?

quick drill

Asha has pancakes.md, pancakes-old.md and pancakes-final.md. What is the main thing these copies cannot tell her?

quick drill

Which of these projects would benefit from version control?

Remember

  • Version control saves snapshots, so any past state is one step away.
  • Every feature is record, look back, compare or combine.
  • It is a history with reasons, not just a backup; you still need a copy off your machine.

Practice — level up

0/1 solved

Write your answer, then compare it with a rubric and a model answer.

ExplainConvince a friend

A friend keeps essays as essay.docx, essay-v2.docx and essay-final.docx. Explain what version control would give them that these copies do not, using at least two concrete situations.