Hi, I'm ThadeusB.

I code stuff. I raise bees. I game.

Version Control Systems Compared - Subversion vs Mercurial vs Git vs Bazaar

What I need in a version control system

I am mainly interested in two things.

  • Managing source code (obviously)

  • File system backup

You would expect the requirements for the two would be completely different, however when examining what features each would need, I noticed I would like the same thing to be used for my source code as well.

As far as file system backup is concerned, I want to be able to plug a terabyte external disk into my computer that will hold the repository, commit, and be happy. Also being able to program a custom interface for the repository so I can browse through my files ( like time machine for mac ). I do not want a local copy of the repository. My file system is the local copy.

Here is the run-down of what would make a perfect version control system for me.

  • Does not litter file system.
  • Easy user management
  • Secure ( SSH )
  • Allow commits through SSH only
  • If a project private, allow pulls through SSH only
  • Folder level permissions
  • Web interface that respects the folder permissions
  • One repository for all projects
  • Ability to organize folders inside of repository
  • Fast ( Subversion is slow )
  • Handles binary files correctly
  • Easy deletion and rename of files
  • Cross platform IDE integration
  • No command line
  • Ability to be used like a client server model

X = Allows for O = Allows for with extra time/hacking

Subversion

Mercurial

Git

Bazaar

Does not litter file system

  • X Mercurial
  • X Git
  • X Bazaar

Easy User Management

  • X Subversion
  • X Mercurial
  • O Git
  • X Bazaar

Secure ( SSH )

  • X Subversion
  • X Mercurial
  • X Git
  • X Bazaar

Folder Level Permissions

  • X Subversion
  • O Mercurial
  • O Git
  • O Bazaar

Web Interface that respects Folder Level Permissions

One repository to rule them all

  • X Subversion
  • O Mercurial
  • O Git

Fast – Handles binary files correctly

  • X Subversion
  • X Mercurial
  • X Git
  • X Bazaar

Easy deletion and rename of files

  • X Mercurial
  • X Git
  • X Bazaar

Cross platform IDE integration

  • X Subversion
  • X Mercurial
  • O Bazaar

No command line

  • X Subversion
  • O Mercurial

Centralized Server

  • X Subversion

Total Scores:

Subversion - 4 Mercurial - 2 Git - -2 Bazaar - 0

What I choose:

If I can get Mercurial to be working the way I want it by the end of this weekend I will be using it. If not I will continue to use SVN for source control since it already does a good majority of what I need out of the box. The main reasons for ditching SVN are slow update/commits and the way it complains when I delete a file. Mercurial is the best choice for file system backup in my opinion. I do not have much experience with Bazaar and Git, and most of the information about them came from doing a simple google search on the topic in question. Most of what I have read is all three of the DVCS handle things basically the same, but with different speeds and repository sizes. Git is generally the fastest/smallest however it is not natively cross platform which throws it out of the water. Bazaar not having a plug-in for my favourite IDE (netbeans) throws it out of the water. This is why I did not spend as much time researching these two.

The Details:

Does not litter file system

The VCS cannot litter my file system with it's own stuff. This is one of the most frustrating things I find about subversion is all of the '.svn' directories. This is important for file system backup as well as software. When I am writing a program to include a sub directory, it pulls the .svn, and I will have to manually code in a ignore .svn into my programs. Mercurial, Git, and Bazaar both have a single directory at the top of the repository.

Running Score: Subversion - 0 Mercurial - 1 Git - 1 Bazaar - 1

Easy user management

Adding new users and permissions should be relatively easy. I don't mind going into shell to manage users and permissions. For my needs I will basically be the only user that has commit privs, everyone else will be guest. However, creating a user and adding them to a repository should take no more than a couple of commands.

All of the VCS in question have fairly easy user management. No score adjustment.

Secure ( SSH )

I must be able to use the repository over SSH for updates and commits. Commits must only be allowed over SSH. Private projects must only allow updates through SSH.

All of the VCS have ways of updating and committing through SSH, however none of them provide the fine grained control of allowing only ssh that I require. If you have SSH enabled, the HTTP channel is also enabled. So I am left to convention and trusting others to download private projects securely. No point adjustment since no VCS suite my needs perfectly in this area. This is only the case for when using for example "hgwebdir" on mercurial. With the DVCSs you can use it by convention and only access it through SSH.

Folder Level Permissions

Applying different permissions to different folders on a per user basis. I may have one repository where I want my best friend Joe to be able to access everything how ever I only want Jim the shady sales rep to have access to the documentation folder.

SVN - Allows for this. And even on a update/commit basis. If Jim tries to update from the source code tree, he gets a nice 'you do not have permission to access these resources'

HG, Git, and BZR are basically the same in this area, they do not allow for this kind of fine grained centralized control.

Running Score: Subversion - 1 Mercurial - 0 Git - 0 Bazaar - 0

Web interface that respects folder level permissions

I want a web interface that lists all of my projects with little configuration ( tell it where the repositories are located and it figures out the rest ). If a repository is marked as private, do not show it in the web interface until the user authenticates, while still allowing the guest to view all of the public repositories.

SVN - With third party software this is possible. However you must configure users and permissions for both the repository AND inside of the software. Not a big deal but a pain.

HG - Does not allow for this in the way that I am wanting. If I have private password protected projects, hgwebdir will still display those private projects for the whole world to see/download. A way around this is to host two hgwebdirs, one for public repositories, one for private. That is quite annoying. I can make do with it, however this requires time.

GIT - I don't even want to go there.

BZR - Doesn't seem to have any references to a native web interface.

Running Score: Subversion - 1 Mercurial - 0 Git - -2 Bazaar - -1

One repository to rule them all

Unfortunately I am lazy. I do not want to leave my IDE to create a new repository for a project on my server. I also organize projects within my repository such as AI, Games, Utils, School. If someone wants to check out the entire Games folder they should be able to. This allows my code base to have some sort of logical structure to it. Making the repository a hierarchical instead of flat.

SVN - Allows for this

HG - Does not allow for this. To a degree I can have a file structure as mentioned above, however the folders AI, Games, Etc. cannot be checked out by themselves. hgwebdir does not see the repositories when they are organized hierarchically.  Forest plug-in cannot be used since forest plug-in does not integrate with my IDE. I can work with this if needed.

Git - Does not allow. ( allows with plug-in )

Bzr - Does not allow. ( allows with plug-in )

Running Score: Subversion - 2 Mercurial - 0 Git - -1 Bazaar - -1

Fast - Handles binary files correctly.

Using the VCS for file system backup it must be able to handle changes to binary files correctly, and fast.

They all use a binary diff algorithm. However when I alter a binary file with my IDE. subversion has a habit of doing a remove and add for the file, having to upload the entire thing again.

Running Score: Subversion - 2 Mercurial - 1 Git - 0 Bazaar - 0

Easy deletion and rename of files

If I am keeping my entire file system under version control, there are going to be alot of changes. If I delete x number of files or rename a file, I don't want my VCS complaining about it. This goes for source code as well. When I clear out my binaries directory to create new binaries, I do not want complaints.

SVN - Horrible,  makes me crinch in horror when I think about , deleting a directory without using the svn command line. And once you delete the directory, svn will not let you commit, or update for that matter. And since the file is deleted you cannot get it back, so I end up having to make a copy of my folder, deleting it, re-check out the files, then make my changes, then delete the folders from my remote repository, and then delete said folders from local working copy, then hope it works!

HG - I haven't seen anything handle file deletion and file rename as beautifully as HG

Git, Bzr - Handle file rename and deletion.

Running Score: Subversion - 1 Mercurial - 1 Git - -1 Bazaar - 0

Cross platform IDE integration

I work in multiple environments, and use the right IDE for the right job. When I'm on Linux I use Netbeans for basically everything. However when I am working on the .NET framework (C#, VB) I am using Visual Studio on Windows.

SVN - Has very mature and reliable plug-ins for almost every major IDE out there.

HG - Has a working plug-in for Netbeans. Visual Studio integration is clunky at best.

Git - Windows? Is that those things I have covered with tin foil so the sun doesn't get in?

Bzr - What plug-ins there are, are buggy. No Visual Studio plug-in that I know of.

Running Score: Subversion - 2 Mercurial - 2 Git - -3 Bazaar - -1

No Command Line

Back to the lazy programmer again. When I create a new project, I do not want to leave my IDE to share the project with my central server. There should be no reason I have to SSH into my server and initialize the project then push to it.

SVN - Allows for this as long as your using the "One Repository To Rule Them All"

HG - Does not allow for this. It could be possible to create an automated script to create the project on my server, however this requires that extra step.

Git, Bzr - Allow for this.

Running Score: Subversion - 3 Mercurial - 2 Git - -2 Bazaar - 0

Centralized Server

So far I am a single developer. I like the ability to be able to access my code no matter where I am, or what computer I am on. I don't mind the only copy being on the server.

SVN - Allows for this

HG - You can make it work, however it requires quite a bit of fence jumping to set up.

Git, Bzr - Same as HG

Running Score: Subversion - 4 Mercurial - 2 Git - -2 Bazaar - 0