Skip to content

Version control

Also called: version control system, version control systems, VCS, revision control

Published:

What is version control for?

According to the Pro Git book, a version control system lets you revert selected files or a whole project to an earlier state, compare changes over time, and see who last modified something that might be causing a problem [1]. If you break something or lose files, recovering is straightforward.

Plenty of people start by copying files into another directory. The book points out that this is popular because it is simple, but it is also very error prone: it is easy to write to the wrong file or copy over one you meant to keep [1].

What kinds of version control are there?

RCS, a well-known local system, stores patch sets, the differences between files, on disk and rebuilds any file as it was at any point by applying them [1]. Centralised systems such as CVS, Subversion and Perforce keep every versioned file on a single server that clients check files out from [1].

In distributed systems such as Git, Mercurial and Darcs, clients do not just check out the latest snapshot. They mirror the whole repository, including its full history, so every clone is a full backup of the data [1].

What difference does distributed make in practice?

In Git, most operations need only local files, because the entire project history is already on your disk [2]. For example, you can work on a train with no connection, commit to your local copy, and upload everything once you are back online [2].

Frequently asked questions

Is version control the same as Git?

No. Version control is the general idea; Git is one distributed version control system. Subversion and Mercurial are others.

Is version control only for code?

No. It records changes to any file or set of files, so it works for other kinds of files too.

Sources

  1. 1.1 Getting Started - About Version Control — Pro Git, git-scm.com
  2. 1.3 Getting Started - What is Git? — Pro Git, git-scm.com