Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git or Subversion for binary files

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.

like image 563
Aleris Avatar asked Sep 10 '25 17:09

Aleris


2 Answers

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

like image 174
Daniel F. Thornton Avatar answered Sep 12 '25 08:09

Daniel F. Thornton


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).

like image 37
gahooa Avatar answered Sep 12 '25 09:09

gahooa