26

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.

Peter Recore
  • 14,037
  • 4
  • 42
  • 62
Aleris
  • 7,981
  • 3
  • 36
  • 42
  • I would be interesting to include mercurial in the question ;-) – FerranB Jul 14 '09 at 20:16
  • 2
    If you are concerned, or just interested in storage requirements for MS Word documents, you might take a look at: http://stackoverflow.com/questions/1320654/will-subversion-efficiently-store-openxml-office-documents – RjOllos Nov 10 '09 at 06:48

4 Answers4

37
  • 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!

Community
  • 1
  • 1
Daniel F. Thornton
  • 3,687
  • 2
  • 28
  • 41
15

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 than subversion in our usage patterns (large projects with 20,000+ files).

gahooa
  • 131,293
  • 12
  • 98
  • 101
  • Do you use any visual tool to work with it? The users of our repository are mostly business analysts that will scramble in horror if we offer anything else. – Aleris Jul 14 '09 at 15:52
  • I have use msysgit on windows. But not enough to tell you if it is very easy or not. TortoiseSVN is quite easy to use, I know that from experience. – gahooa Jul 14 '09 at 17:35
  • 1
    Which size is your Git repository for the administrative office? – FerranB Jul 14 '09 at 20:16
  • @ FerranB: more than 2GB currently. – gahooa Jul 15 '09 at 14:56
  • 1
    There are also visual tools for Git à-la TortoiseSVN: TortoiseGit and GitCheetah. – RFelix Jul 16 '09 at 23:54
  • Thanks for comparison information. Could you collect some concrete data about : amount of all files, size of all files, average size, amount of data changed each day etc... and times for SVN and GIT ? I think such whitepaper would be great for git community, as argument :). – Grzegorz Wierzowiecki Jan 23 '12 at 22:14
13

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.

Greg Hewgill
  • 951,095
  • 183
  • 1,149
  • 1,285
  • 24
    This compares TortoiseSVN vs TortoiseGit, not really svn vs git. This also asumes the user is a ms windows user, and that he won't use the official svn or git clients. Too many assumptions, I've the exact same question for JPEGs instead of DOCS, and I find the answer totally unrelated. – WhyNotHugo Jun 26 '11 at 15:49
  • 2
    Have a look at the Chapter _"[Git Attributes](http://progit.org/book/ch7-2.html)"_ from the book _Pro Git_. It explains how to set a diff tool for a specific filetype. – jnns Jul 14 '11 at 11:07
  • Nevermind, TortoiseGit now supports comparing Word documents natively :-) – jnns Jul 14 '11 at 11:40
  • If you do not need push comments nor file locking, please consider taking a look at Sparkleshare. It's a "private Dropbox" based on Git, with clients for nearly every platform. – frandevel Apr 08 '13 at 20:52
3

TortoiseGit supports full git workflow for Office documents delegating diff to Office itself. It works also delegating to OpenOffice for OpenDocument formats.

Antonio Bardazzi
  • 2,996
  • 1
  • 23
  • 20