Programming
Article

Version Control Software in 2014: What are Your Options?

By Shaumik Daityari

Imagine software that creates checkpoints in your work and allows you to go back to those checkpoints when you want. This essentially means revisiting your work back in time. Once you are back to such a checkpoint, you can also deviate from the original path that you chose. This is exactly what version control systems do for you!

When using version control, the main code is present on one central repository or distributed over many repositories. Everyone working on the code has a local copy of what they are working on in their local or remote systems. This local copy may be a file, some files and directories or the whole repository, depending on the software. Version control system software helps in the management of this code. Besides that, non programmers can also use such software, for example, to manage documents.

In this post, I will offer a quick review of version control software options that we currently have at our disposal. Version control software is broadly divided into two categories — centralized and distributed. Centralized systems have a single central copy of the code on a server and developers commit changes to this central copy only. In distributed systems, every user has a copy of the code, with full history of the project.

Git

Git, which which is a distributed version control system, is arguably the most popular version control system today. It was developed by Linus Torvalds to address the issue of speed with existing version control systems. A wide range of organizations worldwide prefer Git to manage their code, as Git provides a huge range of features.

Git

With the emergence of popular websites like GitHub, GitLab, and BitBucket, code review using git has become very easy. That is why new organizations are choosing git over others.

Notable internet giants who use Git for version control are Twitter and Quora. In fact, Twitter’s open source work is on GitHub. As of March 2014, their Bootstrap project is the most popular repository on GitHub with about 67,000 stars and over 24,000 forks!

In case you’re interested in the philosophy behind the development of Git, here is a video of Linus Torvalds’ Google tech talk on Git. He talks of the issues with CVS and SVN and how Git solves these.

If you’re new to Git, you can try this beginners tutorial.

Subversion (SVN)

Subversion was created as an alternative to CVS (Concurrent Versions System), which has been around for about three decades. Thus, Subversion offers the best features of CVS with some improvements. Subversion puts emphasis on centralized code, whereas other popular version control systems today are “decentralized” (or distributed).

Subversion (SVN)

Although it overcomes a few of the deficiencies of CVS, Subversion has a few drawbacks of its own. Subversion is often found to be slow and lacks certain features of its counterparts. For instance, subversions branching lacks many features in comparison with Git or Mercurial.

With Subversion, branches are created centrally rather than in your local machine, which means there can’t be two branches with the same name. As Linus explains in his talk linked above, there can be branches from “test1” to “test5000” too, making it very difficult to understand! Subversion also implements renaming of files in a weird way. It makes a copy of the file or directory to the new name and deletes the one associated with the old name.

In recent years, many popular open source organizations like Rails and PHP have moved on from Subversion to Git.

Why would you want to use Subversion over Git or Mercurial today if large organizations are moving away from it? Subversion enables you to restrict the access to certain directories for specific users using the path based authorization. The same structure is also possible in Git, but you would have to split your main repository into many smaller ones and restrict access to one of the required smaller repositories. This makes the whole process a bit complex.

For an intro to Subversion you can check out this free book, available online in HTML format or as a PDF.

Mercurial

Mercurial, much like Git, is a free and distributed open-source system. Mercurials main objectives are high performance, scalability, along with advanced branching and merging capabilities. It has advantages similar to those of Git, but there are certain disadvantages too.

Mercurial

Although it started out at roughly the same time as Git, Git has the edge at present. One organization that has shifted from a Subversion server (with a Git mirror) to Mercurial is Facebook. The main reason they chose mercurial over Git is Mercurial’s clean, modular, Python code that was easier to extend. As a result, Facebook engineers contribute actively to Mercurial.

If you prefer Mercurial over Git, you can host your code on BitBucket.

For a beginner’s tutorial on Mercurial, you can check out Hg Init.

Notable Mentions

Although we have covered the most popular version control systems, there are quite a large number of such systems. One, already mentioned, is CVS (Concurrent Versions System), which has been around since the 80s. It was widely used until the emergence of Subversion and Git. CVS allowed users to register their changes on a first-come first-serve basis and allowed only the latest version of the code to be worked upon and edited. This meant that you needed to commit your code first if you didn’t want to incorporate everyone else’s changes!

Another version control system that I should mention is Perforce. This is a commercial version control system, used by companies like NVIDIA and Ubisoft. Perforce also has a Git plugin to integrate with your existing Git repositories.

Yet another option is Bazaar. Like Git and Mercurial, Bazaar is a distributed version control system and is promoted under the the tagline “version control for human beings”. If you are interested, you can check out their well written documentation.

Conclusion

As evident from this list, you have a lot of options when it comes to version control systems. What you choose to use is largely up to your requirements and to a certain extent, your taste. Generally, people will opt for the system that they have some experience with already. And I should note that many other services like Google Docs provide basic revision control and you should consider a simpler service like that if your needs are minimal.

If you have experience with any alternative options for version control, please let us know in the comments.

  • https://twitter.com/dmathisen36 dmathisen

    No mention of TFS or Surround???
    (just kidding) :)

    • therealdrag0

      It’s all about VSS ;P

  • marioosh

    On Bitbucket you can host your code with Mercurial but Git is allowed too.

  • http://wikichua.com/ Wiki Chua

    Why not zip and archive file? (im kidding too) :p

  • http://www.ericlin.me Eric Lin

    We have switched from SVN to Git, but one drawback of Git is that it is not easy to host yourself, you rather have to use GitHub or BitBucket (that was what I heard, never tried myself though).

    • http://abbyandwin.net/ sherwin

      have you checked out gitlab? https://www.gitlab.com. we use bitbucket ourselves, it’s free up to 5 developers and supports both private and public repos.

    • http://dada.theblogbowl.in/ Shaumik Daityari

      Hi Eric,

      One suggestion is to use the self hosted version of GitLab(https://www.gitlab.com/). We use it at IMG, IIT Roorkee (http://img.channeli.in/blog/Tools-we-use-to-work-at-IMG/).

    • Greg

      Give GitLab a try! https://www.gitlab.com

    • http://www.odoo.co.th OpenERP/Odoo Asia

      We use gitblit (http://gitblit.com/). It’s wonderful. Easy to install on a linux server. Running on a server with more than 400 git repositories for about 15 users.No problem at all…

      • mobileteco

        what are extra feature in this , i m new to gitblit and i have installed , but how to add that hipchat

  • LouisLazaris
  • http://dada.theblogbowl.in/ Shaumik Daityari

    Hi Marioosh!

    I did mention BitBucket under Git too :)

  • Scott

    Get used to Git

  • Chu Quang Tú

    Nice article. I’m using both SVN and Git. SVN is easier for beginner than Git. If you want to use Git, you must make some research and practise first, but SVN is more easier and people can immediately using it. But as the article mentions, SVN is more more more weaker than Git, it’s heavier and slower. Highly recommend everybody make a first “push” with git.

  • http://www.ericlin.me Eric Lin

    Thanks Greg, I will give it a try.

  • http://www.ericlin.me Eric Lin

    Thanks Shaumik, looks promising.

  • JoeInOttawa

    These are Good Version Control options. However, Version Control is such a small portion of Software Configuration Management (SCM). So, unless you’re just using it for person use, you may want to delve deeper. And unfortunately, if you start with only version control, you’ll soon enough have to expand to a fuller SCM, but you will have restricted your choices. Take a look at CM+ from Neuma Technology (www.neuma.com). Yes it’s $100s per user, but that includes things like problem tracking, project/task/story management, build and release management, requirements tracking, test suite and test result management, document management, change management, and a host of other capabilities, all which can be easily customized to an organization’s needs. Best of all, setup is done in minutes and administration is near-zero. You really need to go beyond VC in 2014.

  • chicagoj

    I’ve used Kiln from Fog Creek Software (fogcreek.com/kiln). Kiln has both git and mercurial. Also, its free for 2 people to use and doesn’t require public repositories.

  • Rachel Jia

    For those who had experience with Visual SourceSafe before, SourceAnywhere (www.dynamsoft.com/Products/SourceSafe-alternative.aspx) would be a good option.

  • sigilin

    So the article basically says: GIT rocks and all other tools suck because… well… they are not GIT.
    Brilliant! :/
    I personally hate GIT, it’s an overengineered, overly complex system which makes 90% of the most frequent tasks any down-to-earth developer would need to carry out on a day-to-day basis essentially a nightmare… all in exchange for a 10% of value added by features inherent not to the tool, but to the distributed approach altogether.
    If you think you’re sexier cause you use the most complex tool and pretend not sweating a drop, congrats… GIT is probably your thing.
    If you are the pragmatic kind of person, then use SVN or any other (simpler) system.
    In regard to those which say SVN is slow… what on earth does that possibly mean? It’s not like GIT is a programming language you are using for rocket landing realtime control systems… you are just versioning code! So it take 3 more seconds to checkout / commit 20 files from SVN than GIT… who cares!?!?

    • RandomGuy

      man, The writer just compared different version tools currently available in the market. He didn’t claim GIT is the only option a developer has for being successful in delivering a project. He even wrote a conclusion saying, “choosing a version tool is entirely up to your choice”.

      The writer didn’t even claim he is sexier than other developers because he is using GIT. how can one person be sexier for using a stupid version tool?. your comment doesn’t make any sense.

      one thing is sure from your comment that you really hate GIT and also people who use GIT.

  • Роман Пешков

    Link to mercurial “disadvantages” is really stupid. It shows disadvantages of mercurial branching with clones that is not the best option for branching at all. Use mercurial named branches or bookmarks for branching.

  • orangina

    Oh man, that Git picture– Git is easy to learn? Git is far too difficult for a noob. I’ve recloned things twice, just abandoned all my changes multiple times, and it’s a constant time sink because I can’t push anything without getting latest, but latest data isn’t necessarily built… I know it’s not your picture, but man. I haven’t seen any site about git that doesn’t say, “here, read this 50 page book, then you’ll understand how to contribute to a git project.”

  • Gary Schultz

    When I first used Git at my previous employer I wasn’t too fond of it. I now realized that the systems architect at my previous employer did a poor job integrating Git into our workforce. Since leaving my previous employer I decided to give Git another try using the free service from BitBucket and now love Git. For Windows and Mac, and Linux under WINE, the free SourceTree Git client from Atlassian rocks. Atlassian also provides many free Git learning resources. Atlassian makes Git easy. If you have never tried GIt before, I highly recommend BitBucket.

    • https://twitter.com/dmathisen36 dmathisen

      +1 for Atlassian. They’re products are really solid and helpful. Git and Jira integration into HipChat is pretty amazing.

  • Taraz

    Plastic SCM!

  • Gurce Isikyildiz

    I came here via a google search on wanting to learn how to select between version control systems. I’m content with what I read, and the final conclusion of it being up to your requirements and taste. At the end of the day, all version-control systems do a reasonable job in keeping track of your software changes. Some are harder to learn, some are easier. Once you master one system and become very fluid with it, it becomes hard to change to another system. Still, as a developer, life has a way of forcing us to learn new tools that we don’t always like, eg, switching between jobs and your new workplace uses new tools you’ve never heard of. I wonder how managers decide on a vcs for their team. A considerate way might be to poll their developers to see what vcs they’re familiar with and prefer. If there’s any sort of majority consensus, choosing that path might save the bulk of developers from another round of re-learning. Although, another approach might be to assess the unique capabilities of each vcs and decide which set of facilities support the style of project within the company the best. I suppose cost could be a factor too, if funds are limited at the company, perhaps the choice is limited to free vcs options. Companies with big pockets might consider purchasing commercial products that offer vcs+extra integration with bug-tracking, project management and maintenance/support contracts to help you fix vcs-server issues asap. Anyway, there sure is a lot of choice out there, each vcs takes time to master all of its options and nuances. Comparing them side-by-side is an exhausting endeavour. Anyway, good luck to those making their vcs selections :)

  • abxplorer

    Nice article. I need some advise from the experts here. I am using GIT already for code version control. But, when we want to run an application on a machine(s), it requires so many OS related packages along with some 3rd party packages. Is there a way to keep track/control their versions too? I have been searching in this direction but couldn’t find anything concrete. Though I feel, this will also be a huge requirement over Software development cycles. What if tomorrow someone wants to run a 1 year old build/code-base, related packages with that build will be required as well.. Seeking answers/pointers to somewhere relevant.

  • Forrest Haller

    I would like to add the reason why perforce is used by big game development companies is that it is much nicer when dealing with massive files (which there are a lot of in game development). I just noticed you forgot to mention this point.

Recommended

Learn Coding Online
Learn Web Development

Start learning web development and design for free with SitePoint Premium!

Get the latest in Front-end, once a week, for free.