具有最少磁盘空间开销的版本控制 [英] Version control with the least disk-space overhead

查看:28
本文介绍了具有最少磁盘空间开销的版本控制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在考虑使用像 SVN 这样的版本控制系统作为我使用的几台 PC 之间的通用备份和同步工具.这将适用于各种数据,包括 MP3 和翻录的 DVD - 大量数据 (120gb+).

I've been considering using a version control system like SVN as a general-purpose backup and synchronisation tool between the few PCs I use. This would be for all sorts of data, including MP3s and ripped DVDs - a LOT of data (120gb+).

我的主要问题是 SVN 在 .svn 目录中创建每个版本文件的副本.虽然我可以看到这在大多数情况下非常有用,但对于我的目的来说完全没有必要,而且会浪费大量磁盘空间.

My main issue is that SVN creates a copy of each versioned file in the .svn directory. While I can see that this is very useful in most cases, it's entirely unnecessary for my purposes, and a massive waste of disk space.

是否有 VCS 不会在您的工作副本中创建文件的副本?

Is there a VCS which doesn't create a duplicate of the files in your working copy?

编辑以澄清:我只是在谈论每台计算机上所需文件的大小.对于 SVN,这意味着工作副本及其元文件的大小 - 对于 DVCS,这意味着 WC 和存储库的大小.

Edit to clarify: I'm just talking about the size of the required files on each computer. For SVN, that'd mean the size of the working copy and its meta files - for a DVCS, that'd be the size of the WC and the repository.

推荐答案

Git 非常节俭到磁盘空间.

Git is extremely thrifty when it comes to disk space.

Git 与 SVN 比较 Wiki 指出:

与 SVN 相比,Git 的存储库和工作目录的大小非常小.

Git's repository and working directory sizes are extremely small when compared to SVN.

例如,据报道 Mozilla 存储库使用 fsfs 后端存储在 SVN 中时几乎 12 GiB.fsfs 后端还需要一个目录中的 240,000 多个文件来记录 10 年项目历史中的所有 240,000 次提交.完全相同的历史记录仅通过两个文件存储在 Git 中,总大小超过 420 MiB.SVN 需要 30 倍的磁盘空间来存储相同的历史记录.

For example the Mozilla repository is reported to be almost 12 GiB when stored in SVN using the fsfs backend. The fsfs backend also requires over 240,000 files in one directory to record all 240,000 commits made over the 10 year project history. The exact same history is stored in Git by only two files totaling just over 420 MiB. SVN requires 30x the disk space to store the same history.

一个 SVN 工作目录总是包含每个文件的两个副本:一个供用户实际使用,另一个隐藏在 .svn/中以帮助诸如状态、差异和提交之类的操作.相比之下,Git 工作目录只需要一个小的索引文件,每个跟踪文件存储大约 100 字节的数据.对于包含大量文件的项目,每个工作副本所需的磁盘空间可能会有很大差异.

An SVN working directory always contains two copies of each file: one for the user to actually work with and another hidden in .svn/ to aid operations such as status, diff and commit. In contrast a Git working directory requires only one small index file that stores about 100 bytes of data per tracked file. On projects with a large number of files this can be a substantial difference in the disk space required per working copy.

这篇关于具有最少磁盘空间开销的版本控制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆