二进制文件的 Git 或 Subversion
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1126239/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Git or Subversion for binary files
提问by Aleris
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.
我们需要将二进制文件(主要是 MS Word 文档,大小从几 KB 到几 MB)存储在具有 100 多个“项目”的版本控制存储库中。目前我们使用的是Visual Source Safe,但是存在一些问题,数据库有时会崩溃,访问速度很慢。
We are considering moving to Git or Subversion and we were wondering which one would be a better option for handling binary files.
我们正在考虑迁移到 Git 或 Subversion,我们想知道哪一个是处理二进制文件的更好选择。
采纳答案by Greg Hewgill
Subversion, definitely. Today (2009), TortoiseSVN provides Explorer-integrated navigation of Subversion repositories, and most particularly it supports diffingof arbitrary Word documents (it defers the diff to Word itself, but the feature works really well).
颠覆,绝对的。今天(2009年)时,TortoiseSVN提供了Subversion版本库的资源管理器集成导航,最特别是支持版本比较的任意Word文档(它会推迟DIFF到Word本身,而是功能的作品真的很好)。
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.
TortoiseGit 没有理由不能具有相同的功能,但今天这样的东西并不完全以稳定的形式存在。幸运的是,将来随时可以轻松地将 Subversion 存储库迁移到 Git。
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.
更新:截至 2011 年,TortoiseGit 显然具有与 TortoiseSVN 相同的文档管理功能。但是,Subversion 支持建议性锁定文档,以便其他用户在尝试与其他人同时编辑文档时收到通知。据我所知,由于 Git 的分布式特性,TortoiseGit 无法支持此功能。
回答by Daniel F. Thornton
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 .gitattributesfile in your source repository.
Hereis a comparison of Git and SVN's binary file handling.
Hereis what some other Stack Overflow members have been doing with Git and binary files.
Subversion 尝试自动检测二进制文件(请参阅SVN 常见问题解答)。如果失败,你必须自己指定它们(你也不能改变SVN的检测方法)。
Git 也是如此,您可以通过在源存储库中包含.gitattributes文件来指定要自动将哪些文件视为二进制文件。
这里是 Git 和 SVN 的二进制文件处理的比较。
以下是其他 Stack Overflow 成员对 Git 和二进制文件所做的工作。
Hope this helps!
希望这可以帮助!
回答by gahooa
We use git for everything. Literally. Even our administrative office's entire file share is kept in git (the sysadmin commits it each day).
我们使用 git 做所有事情。字面上地。甚至我们行政办公室的整个文件共享都保存在 git 中(系统管理员每天提交)。
That share is almost entirely binary files -- word documents, quickbooks, etc...
该共享几乎完全是二进制文件——word 文档、quickbooks 等......
We have a 100% accurate history of everything. And with an occasional git gc
it keeps the repo size manageable.
我们拥有 100% 准确的历史记录。偶尔git gc
它可以使回购规模保持可控。
Also: git is really fast.When we switched from SVN, git
was ~ 10x faster than subversion
in our usage patterns (large projects with 20,000+ files).
另外:git 真的很快。当我们从 SVN 切换时,git
比subversion
我们的使用模式(具有 20,000 多个文件的大型项目)快约 10 倍。
回答by Antonio Bardazzi
TortoiseGit supports full git workflow for Office documents delegating diff to Office itself. It works also delegating to OpenOffice for OpenDocument formats.
TortoiseGit 支持将 diff 委托给 Office 本身的 Office 文档的完整 git 工作流程。它还可以将 OpenDocument 格式委托给 OpenOffice。