免费的源代码控制系统不需要存储每个文件的本地副本,从而使空间使用量加倍?

发布于 2024-08-06 10:36:31 字数 366 浏览 6 评论 0原文

是否有一个源代码控制系统(除了 CVS 之外)可以配置为不存储文件的本地副本?或者也许它只是没有按设计这样做?理想情况下,可以通过扩展名或文件大小来配置此类选项。

例如,如果我有时确实想在 SVN 中存储大型电影或图片,最终结果是客户端上的空间使用量增加一倍 - 而且没有办法解决这个问题。

我意识到一个解决方案就是不提交此类文件,但我的问题是寻找其他解决方案。

作为记录,我刚刚尝试了 Mercurial (Hg),它也使用了两倍的空间。我怀疑 Git 也会做同样的事情。

PS 我不明白为什么 SVN 不能实现对此的支持。这该有多简单啊——如果文件没有存储在本地,就远程获取它,我相信 CVS 就是这样做的。如果网络当前不可用,则显示错误。 /发泄

Is there a source control system (besides CVS) that can be configured to NOT store local copies of files? Or perhaps it just doesn't do it by design? Ideally, one could configure such option by extension or file size.

For example, if I do sometimes want to store large movies or pictures in SVN, the end result is double the space usage on the client - and there's no way around it.

I realize one solution is just not to commit such files but my question is searching for that other solution.

For the record, I just tried Mercurial (Hg) and it used up twice the space as well. I suspect Git would do the same.

P.S. I don't see why SVN couldn't implement support for this already. How simple would it be - if a file is not stored locally, get it remotely, like CVS, I believe, does. If network is not available right now, show error. /vent

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

油饼 2024-08-13 10:36:31

您可以使用 Bazaar 对分支进行轻量级签出。工作目录将只包含可编辑的源代码,bzr 将为几乎所有操作进行网络查找。但你会发现,即使你使用常规分支,具有所有历史记录的分支的大小通常也小于工作树。

You can use Bazaar with a lightweight checkout of a branch. The working directory will only contain the editable source code and bzr will do a network lookup for almost any operation. But you will find that even if you use regular branches, the size of the branch with all the history is usually smaller than the working tree.

初见终念 2024-08-13 10:36:31

SVN(以及所有其他现代 VCS)旨在存储大量小型文本文件,而不是大量大型二进制文件。所有这些都保留本地副本,因为它很便宜(大多数项目很少使用超过几兆字节),并且它使几乎所有操作(差异、状态、本地提交)变得更快。

所以你使用了错误的工具。如果您需要管理图片,请尝试 Picasa 或类似工具。不幸的是,大多数图像数据库不知道如何保留图像的编辑历史记录(这很遗憾;我已经打开了 针对 digikam 的 bug 几年前,现在仍然处于开放状态)。

我的意思是,保留原始图像并仅保存您所做的所有编辑的选项以及当前的“最终”图像会更有效。之间的所有内容都可以从原始图像重新创建并再次应用操作。就效率而言,世界上没有哪个 VCS 能够超越它(“对比度 +10%”与比较两个 JPG)。

因此,今天最好的选择是使用专业的照片编辑工具(->不是免费的),或者您必须复制并重命名要编辑的照片。

是的,这很糟糕。

如果你所知道的只是一把锤子,那么你就会把所有问题都视为钉子。

SVN (and all other modern VCS) was designed to store lots of small text files, not huge amounts of big binaries. The all keep a local copy because it's cheap (most projects will rarely use more than a few megabytes) and it makes almost all operations much faster (diff, status, local commit).

So you're using the wrong tool. If you need to manage images, try Picasa or something similar. Unfortunately, most image databases don't know how to keep the editing history of an image (which is a pity; I've opened a bug against digikam years ago and it's still open).

I mean, it would be much more efficient to keep the original image and just save the options for all the edits you made plus the current "final" image. Everything in between could be recreated from the original image and applying the operations again. No VCS in the world would be able to beat that in terms of efficiency ("Contrast +10%" vs. comparing two JPGs).

Therefore, your best bet today is either a professional photo editing tool (-> not free) or you must copy and rename photos that you want to edit.

Yeah, it sucks.

If all you know is a hammer, you'll treat every problem as a nail.

千笙结 2024-08-13 10:36:31

我使用过的唯一一个不会产生任何过多额外使用空间的就是普遍讨厌的视觉源安全。

SoureSafe 6.0 仅会产生源绑定的存储开销。

不过,我认为 SourceSafe 是一个源码销毁系统,所以我根本不推荐它。

The only one which i have used which didnt incur any excessive extra usage space was the universally hated, visual sourcesafe.

SoureSafe 6.0 only incurs storage overhead for source bindings.

However, i consider SourceSafe as a source destruction system, so i dont recommend it at all.

献世佛 2024-08-13 10:36:31

ClearCase 仅将本地修改的文件存储在您的工作区域中(称为视图)他们的命名约定)。

ClearCase stores only locally modified files in your working area (called a view in their naming convention).

烟雨扶苏 2024-08-13 10:36:31

这可能听起来很愚蠢(也许确实如此),但是一旦您提交了大文件,为什么不直接删除磁盘上的文件呢?毕竟,VCS 可以准确地用于在您需要时恢复文件。

我刚刚在 Bazaar 上尝试过:

> ls -al
total 7123
drwxrwxrwx   1 user     group           0 Oct  5 11:42 .
drwxrwxrwx   1 user     group           0 Oct  5 11:22 ..
-rw-rw-rw-   1 user     group     2469224 Aug 29  2007 Charles_Darwin_01.jpg
-rwxrwxrwx   1 user     group     4076719 Sep 25 15:35 FileZilla-3.2.7.1.exe
-rw-rw-rw-   1 user     group      746477 Aug 24 18:35 floorplan2008.png

> du -bs
7292420 .

> bzr init
Created a standalone tree (format: 2a)

REM Adding by name to override my own ignore rules, a simple `bzr add` is enough otherwise
> bzr add Charles_Darwin_01.jpg  FileZilla-3.2.7.1.exe  floorplan2008.png
adding Charles_Darwin_01.jpg
adding FileZilla-3.2.7.1.exe
adding floorplan2008.png

> bzr commit -m "Storing big binary files in repository"
Committing to: E:/temp/TestsVCS/Big/
added Charles_Darwin_01.jpg
added FileZilla-3.2.7.1.exe
added floorplan2008.png
Committed revision 1.

> du -bs
14552798        .

> rm Charles_Darwin_01.jpg  FileZilla-3.2.7.1.exe  floorplan2008.png

> du -bs
7260378 .

> bzr add Bazaar-quick-start-summary.pdf
adding Bazaar-quick-start-summary.pdf

> bzr commit -m "Adding good reference" Bazaar-quick-start-summary.pdf
Committing to: E:/temp/TestsVCS/Big/
added Bazaar-quick-start-summary.pdf
Committed revision 2.

> rm Bazaar-quick-start-summary.pdf

> du -bs
7666520 .

REM I want to work on a file
> bzr revert Charles_Darwin_01.jpg
 N  Charles_Darwin_01.jpg

REM I edited the file
> ls -l Charles_Darwin_01.jpg
-rw-rw-rw-   1 user     group     2419048 Oct  5 11:52 Charles_Darwin_01.jpg

> bzr st
removed:
  Bazaar-quick-start-summary.pdf
  FileZilla-3.2.7.1.exe
  floorplan2008.png
modified:
  Charles_Darwin_01.jpg

REM I commit by name to avoid to commit the deletions, 
REM but actually they can be commited without problem
> bzr commit -m "Changed just some IPTC tags" Charles_Darwin_01.jpg
Committing to: E:/temp/TestsVCS/Big/
modified Charles_Darwin_01.jpg
Committed revision 3.

> du -bs
12505785        .

> rm Charles_Darwin_01.jpg

> du -bs
10086737        .
REM + size of image + around 1KB of metadata

注意:这是在 Windows 上,但我使用 UnxUtils 命令,它们在命令行上很方便。

It might sound stupid (and perhaps it is), but once you have committed your big file, why you not just delete the file on disk? After all, the VCS can precisely be used to restore the file when you need it.

I just tried that with Bazaar:

> ls -al
total 7123
drwxrwxrwx   1 user     group           0 Oct  5 11:42 .
drwxrwxrwx   1 user     group           0 Oct  5 11:22 ..
-rw-rw-rw-   1 user     group     2469224 Aug 29  2007 Charles_Darwin_01.jpg
-rwxrwxrwx   1 user     group     4076719 Sep 25 15:35 FileZilla-3.2.7.1.exe
-rw-rw-rw-   1 user     group      746477 Aug 24 18:35 floorplan2008.png

> du -bs
7292420 .

> bzr init
Created a standalone tree (format: 2a)

REM Adding by name to override my own ignore rules, a simple `bzr add` is enough otherwise
> bzr add Charles_Darwin_01.jpg  FileZilla-3.2.7.1.exe  floorplan2008.png
adding Charles_Darwin_01.jpg
adding FileZilla-3.2.7.1.exe
adding floorplan2008.png

> bzr commit -m "Storing big binary files in repository"
Committing to: E:/temp/TestsVCS/Big/
added Charles_Darwin_01.jpg
added FileZilla-3.2.7.1.exe
added floorplan2008.png
Committed revision 1.

> du -bs
14552798        .

> rm Charles_Darwin_01.jpg  FileZilla-3.2.7.1.exe  floorplan2008.png

> du -bs
7260378 .

> bzr add Bazaar-quick-start-summary.pdf
adding Bazaar-quick-start-summary.pdf

> bzr commit -m "Adding good reference" Bazaar-quick-start-summary.pdf
Committing to: E:/temp/TestsVCS/Big/
added Bazaar-quick-start-summary.pdf
Committed revision 2.

> rm Bazaar-quick-start-summary.pdf

> du -bs
7666520 .

REM I want to work on a file
> bzr revert Charles_Darwin_01.jpg
 N  Charles_Darwin_01.jpg

REM I edited the file
> ls -l Charles_Darwin_01.jpg
-rw-rw-rw-   1 user     group     2419048 Oct  5 11:52 Charles_Darwin_01.jpg

> bzr st
removed:
  Bazaar-quick-start-summary.pdf
  FileZilla-3.2.7.1.exe
  floorplan2008.png
modified:
  Charles_Darwin_01.jpg

REM I commit by name to avoid to commit the deletions, 
REM but actually they can be commited without problem
> bzr commit -m "Changed just some IPTC tags" Charles_Darwin_01.jpg
Committing to: E:/temp/TestsVCS/Big/
modified Charles_Darwin_01.jpg
Committed revision 3.

> du -bs
12505785        .

> rm Charles_Darwin_01.jpg

> du -bs
10086737        .
REM + size of image + around 1KB of metadata

Note: that's on Windows but I use the UnxUtils commands, they are handy on the command line.

轮廓§ 2024-08-13 10:36:31

您的图片库有多大?如今,我认为购买另一个 80GB 硬盘驱动器(如果您能在市场上找到这么小的硬盘驱动器)会比购买具有节省磁盘空间功能的源代码控制包更便宜。

Just how big is your image library? These days, I think it would be cheaper to buy another 80GB hard drive -- if you can find one that small on the market -- than to buy a source-code control package with disk-space-saving features.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文