⇧ Overview | ⇨ Next: Practical exercise

<aside> 🔥 A distributed version control system (VCS) records computer files – their histories and variants – and helps with merging different variants.

</aside>

Every coder makes mistakes and needs a time machine ∴ VCS

Most code written isn’t right first time, so people make copies

Anecdotally, most code written isn’t right first time.

This necessitates refining code step by step over minutes, hours, days, weeks, months and years.

A lot of coders at the start of their coding career realise they need to back up the current version before changing it, and save directories (folders) of code with the current “state” of their work on a regular basis, with names like 2023-05-22-working, 2023-05-23-broken, 2023-05-24-hopelessly-broken and so on.

But: This becomes unwieldy, and there is a lot of duplication, and accidentally overwriting the history is easy.

A version control system makes dated, attributed copies which can’t be modified

Version control systems:

You can imagine each “commit” as a snapshot of all the files.

Diagram of 5 versions of three different files.
From https://git-scm.com/book/en/v2/Getting-Started-What-is-Git%3F

Diagram of 5 versions of three different files. From https://git-scm.com/book/en/v2/Getting-Started-What-is-Git%3F

Coders who collaborate often share and merge their work ∴ VCS