二进制文件的 Git 或 Subversion
我们需要将二进制文件(主要是 MS Word 文档,大小从几 KB 到几 MB)存储在包含 100 多个“项目”的版本控制存储库中。 目前我们使用Visual Source Safe,但存在一些问题,数据库有时会崩溃,访问速度很慢。
我们正在考虑迁移到 Git 或 Subversion,我们想知道哪一个是处理二进制文件的更好选择。
We need to store binary files (mostly MS Word documents, ranging from a couple of KB to a couple of MB in size) in a version control repository with over 100 "projects". Currently we use Visual Source Safe but there are some problems, the database is crashing sometimes and the access is slow.
We are considering moving to Git or Subversion and we were wondering which one would be a better option for handling binary files.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
Subversion 尝试自动检测二进制文件(请参阅SVN 常见问题解答)。 如果失败,您必须自己指定它们(您也无法更改 SVN 的检测方法)。
Git 执行相同的操作,您可以通过包含 .gitattributes 源存储库中的文件。
这里是 Git 和 SVN 二进制文件处理的比较。< /p>
这里是其他一些 Stack Overflow 成员使用 Git 所做的事情和二进制文件。
希望这可以帮助!
Subversion attempts to automatically detect binary files (see SVN FAQ). If this fails, you have to designate them yourself (you also can't change SVN's detection method).
Git does the same, and you can specify which files to automatically treat as binaries by including a .gitattributes file in your source repository.
Here is a comparison of Git and SVN's binary file handling.
Here is what some other Stack Overflow members have been doing with Git and binary files.
Hope this helps!
我们用 git 来做所有事情。 字面上地。 甚至我们行政办公室的整个文件共享都保存在 git 中(系统管理员每天提交)。
该共享几乎完全是二进制文件——word 文档、quickbooks 等...
我们拥有所有内容 100% 准确的历史记录。 并且偶尔使用 git gc 可以使存储库大小保持可控。
另外:git 真的很快。当我们从 SVN 切换时,
git
在我们的使用模式中比subversion
快约 10 倍(拥有 20,000 个项目的大型项目) + 文件)。We use git for everything. Literally. Even our administrative office's entire file share is kept in git (the sysadmin commits it each day).
That share is almost entirely binary files -- word documents, quickbooks, etc...
We have a 100% accurate history of everything. And with an occasional
git gc
it keeps the repo size manageable.Also: git is really fast. When we switched from SVN,
git
was ~ 10x faster thansubversion
in our usage patterns (large projects with 20,000+ files).颠覆,绝对是。 如今(2009 年),TortoiseSVN 提供了 Subversion 存储库的资源管理器集成导航,最特别的是,它支持任意 Word 文档的比较(它将比较推迟到 Word 本身,但该功能运行得非常好)。
TortoiseGit 没有理由不能拥有同样的功能,但这样的东西目前还没有以稳定的形式存在。 幸运的是,将来随时可以轻松地将 Subversion 存储库迁移到 Git。
更新:截至 2011 年,TortoiseGit 显然具有与 TortoiseSVN 相同的文档管理功能。 但是,Subversion 支持建议锁定文档,以便其他用户尝试与其他人同时编辑该文档时收到通知。 据我所知,由于 Git 的分布式特性,TortoiseGit 无法支持此功能。
Subversion, definitely. Today (2009), TortoiseSVN provides Explorer-integrated navigation of Subversion repositories, and most particularly it supports diffing of arbitrary Word documents (it defers the diff to Word itself, but the feature works really well).
There's no reason why a TortoiseGit can't have this same feature, but such a thing doesn't quite exist in a stable form today. Fortunately, it's easy to migrate a Subversion repository to Git anytime in the future.
Update: As of 2011, TortoiseGit apparently has the same document management features as TortoiseSVN. However, Subversion supports advisory locking documents so that other users are notified if they try to edit the document at the same time as someone else. To the best of my knowledge, TortoiseGit cannot support this feature because of Git's distributed nature.
TortoiseGit 支持 Office 文档的完整 git 工作流程,将 diff 委托给 Office 本身。
它还可以将 OpenDocument 格式委托给 OpenOffice。
TortoiseGit supports full git workflow for Office documents delegating diff to Office itself.
It works also delegating to OpenOffice for OpenDocument formats.