In recent years distributed version control systems (DVCS) have been getting a lot of momentum and wider usage specially among the open source community.Git is at the head of this DVCS movement being the most popular and widely adopted even by google who recently added Git support to the Google projects platform.
In this article I’m going to take a look at Git and hopefully show you why not only its a better solution for version control than SVN but a way of also improve your workflow and productivity.
Distributed vs Centralized
Git, Mercurial, Bazaar, etc are distributed version control systems. But what does distributed actually mean, Subversion allows you to check out just a subtree of a repository; Git requires you to clone the entire repository (including the repo history) and create a working copy that mirrors the items under version control.
This means that after the clone there is no information about that project that the server has that you do not have. The interesting thing is that Subversion is so inefficient that in general is nearly as fast to clone an entire repository over as it is to checkout a single version of the same repository over Subversion.
Having a local clone of the entire repository has several immediate advantages. First is the ability to work offline; you don’t need an internet connection or to be connected to your company VPN. You can do diffs, commits, create branches, merge them and much more entirely offline. Second Git is insanely fast, most command take only a few seconds even on projects that contain a huge amount of single files like Magento that has little over 40,000 files running “git init” only takes a couple of minutes. Try doing that with SVN and you are going to waiting for the next half an hour.
The architecture is also less vulnerable as it doesn’t have a single point of failure, since every person has a working a working copy of the project that is essentially a full backup of the project data; losing your main server is a minor problem at best.
I have seen a couple of cases where an SVN server had drive corruption, data center failure, etc and this translate into heavy loses in time, productivity and of course money and many times there was a considerable amount of data lost all depending on the latest backup of that SVN Server.
Same scenario with Git is just matter of any of the developers pushing the repo into any server where the whole team can SSH and you are back and running in minutes.
Your Workflow enhanced
Git does not depend on a centralized server, but it does have the ability to maintain synchronization with other Git Repositories, you can add multiple remote repos to your project; read-only or write access, this allows you to have almost any type of workflow that you want.
Pro Git covers with a lot of detail the types of workflow you can have with git; you can even continue using a centralized type of workflow with one central repo that everyone pushes and pulls from.
To Be Continued …
So we have only scratch the surface of what Git is and how can really change and improve not only your workflow but your entire team workflow. In the next article we are going to dive into some more concrete examples of how to use Git to achieve this.

Comments (0)