Is there a fundamental difference between backups and version control?

前端 未结 17 1019
自闭症患者
自闭症患者 2020-12-29 23:22

How does version control differ from plain backups?

Let\'s forget about the feature decoration, and concentrate on the soul of version control. Is there a clear line

17条回答
  •  抹茶落季
    2020-12-30 00:23

    I see several fundamental differences between backups and version control:

    1. Backups only store the latest version, or, even if they store multiple versions, they don't store every version. A VCS does store every version,
    2. That backup version is often out of date, because backups don't record every change, while VCSs do,
    3. VCSs allow to pursue multiple alternative versions of the same change at the same time (i.e. branching).

    However, the single most important difference between backups and VCS is that, in a VCS, changes have meaning. In a backup, a new version is made, because some computer somewhere decided that it was x hours since the last backup; the change itself is completely meaningless. In a VCS, a new version is made, because some human decided that this version has its own meaning, its own identity, different from all the other versions. So, in a backup, all versions are equal (more precisely: they are equally meaningless), whereas in a VCS all versions are special (they have their own unique meanings). In a VCS, changes have an actual history, where one event led to another, in a backup there's just a string of unrelated events.

    Closely related to this, is the notion of change metadata. In a VCS, every change has an author, a timestamp and, most importantly, a commit message. This commit message records why the change was made, in other words, it records the "meaning" I wrote about in the previous paragraph.

    The commit history and especially the commit messages are the most important data in a VCS repository, not the actual code itself! This metadata is completely absent in a backup.

提交回复
热议问题