Is there a fundamental difference between backups and version control?

前端 未结 17 928
自闭症患者
自闭症患者 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:12

    I would consider backups a very basic version control system. I would not recommend it for lots of things, but if I have a small script on my home computer, I use dated backups instead of a full featured VCS. This is OK because I am the only one to change the file, so I do not need to worry about conflicts or who made a change.

    0 讨论(0)
  • 2020-12-30 00:14

    The bare minimum requirement for a backup system to have in order for it to be used for version control is incremental backup and restore for discrete backup items. Additional features (Collaboration, Branching, Diff Comparison) may make it a better VCS system, but insofar as you can control versions as long as you can have reliable access to retrieve and rollback to incrementally different versions of an item you have backed up, you can use it as a "VCS". So, I suppose the fundamental difference between a backup and version control system is what you are using the system to do. Particularly given that you could, if you desired, use your VCS as your backup system.

    0 讨论(0)
  • 2020-12-30 00:15

    Perhaps they are fundamentally the same, until you add the word "good".

    • "good" VCS is very fast.
    • "good" VCS allows multiple sources of changes (multiple users).
    • "good" VCS allows merging.
    • "good" VCS has metadata, like user-provided descriptions

    • "good" backups are distributed geographically

    • "good" backups work automatically.
    0 讨论(0)
  • 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.

    0 讨论(0)
  • 2020-12-30 00:23

    Version control is collaborative, backup is just a snapshot.

    Example: With version control two people can edit the same file concurrently, and the system is smart enough to merge the changes together. With backup, which version of the file would "win?" Backup never "merges" two different backups into one "true" backup.

    0 讨论(0)
  • 2020-12-30 00:25

    The basic difference that stands out to me is that version control allows multiple users to easily work on the same code. Backups do not.

    0 讨论(0)
提交回复
热议问题