Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do different version control systems handle binary files?

I have heard some claims that SVN handles binary files better than Git/Mercurial. Is this true and if so then why? As far as I can imagine, no version control system (VCS) can diff and merge changes between two revisions of the same binary resources.

So, aren't all VCS's bad at handling binary files? I am not very aware of the technical details behind particular VCS implementations so maybe they have some pros and cons.

like image 412
Tower Avatar asked Jul 06 '11 15:07

Tower


People also ask

Can version control systems store binary files?

Most version control systems that do handle binary assets have to store them separately. Helix Core stores binaries alongside source code in the same depot. You can easily find and update the file you need, allowing you to streamline your build process.

How does Subversion handle binary files?

If Subversion determines that the file is binary, the file receives an svn:mime-type property set to application/octet-stream. You can always override this by using the auto-props feature or by setting the property manually with svn propset . Subversion treats the following files as text: Files with no svn:mime-type.

What are the three types of version control?

The types of VCS are: Local Version Control System. Centralized Version Control System. Distributed Version Control System.


Video Answer


1 Answers

The main pain point is in the "Distributed" aspect of any DVCS: you are cloning everything (the all history of all files)

Since binaries aren't stored in delta for most of them, and aren't compressed as well as text file, if you are storing rapidly evolving binaries, you end up quickly with a large repository which becomes much cumbersome to move around (push/pull).

For Git for instance, see What are the git limits?.

Binaries aren't a good fit for the feature a VCS can bring (diff, branch, merge), and are better managed in an artifact repository (like a Nexus for example).
This is not necessary the case for a CVCS (Centralized VCS) where the repository could play that role and be a storage for binaries (even if its not its primary role)

like image 133
VonC Avatar answered Sep 21 '22 00:09

VonC