Why Switch to Git?

Overview[1]

Git is a widely used source code management system for software development. It is a distributed revision control system with an emphasis on speed, data integrity, and support for distributed, non-linear workflows. Git was initially designed and developed in 2005 by Linux kernel developers (including Linus Torvalds) for Linux kernel development.

As companies are adopting DevOps practices, they are realizing that their version control system is not only a place to track revisions of their code, but is the backbone of their whole DevOps practice! I highly recommend going through the recent blog post I wrote about how you are not fully utilizing your VCS for some background.

Disclaimer

While I would recommend any and all projects and teams to adopt Git as their primary VCS, please do not try to migrate your teams to Git without proper initial training.

Git (in general, any Distributed VCS) is fundamentally a very different system, compared to traditional VCSes like SVN. This can really confuse developers used to a central VCS. Take your time and develop a migration/training strategy before switching over.

Also, SVN does have very narrow advantages over Git in some edge use-cases. A good comparison of Git and SVN can be found at the Linux Kernel Wiki and at WikiVS. You should consider whether one of these use-cases applies to your team.

Why Git?

Industry Leader

Git's popularity has been rapidly increasing year-over-year. A testament to Git's popularity is that the founders of Subversion, CollabNet, have moved Subversion to a Apache Software Foundation project and are providing Enterprise Git solutions now[1:1].

In the last published Eclipse Community Survey of developers (2014) Git overtook SVN as the most widely used version control system. [1:2]
Git adoption year-over-year

Although not very scientific, the Google search trends also show the interest in Git rising since 2009 and svn declining[1:3]:
Google search trend

As a developer, you will also increasingly see Git as a required job skill[1:4]:
IT Jobs UK

Speed

Due to its distributed nature, Git is an order of a magnitude faster than SVN. There is no network communication involved. Most operations in Git take only a few milliseconds. Operations like switching a branch takes sub-second on even big repositories like the linux kernel.

Here are some benchmarks[1:5]

Integrations

Due to its industry leader status, almost every development tool out there supports Git. In fact, most new tools first support Git and later support SVN or not support SVN at all (Microsoft Visual Studio 2015 has in-built support for Git and not SVN[1:6]). Plugins for integration with CA Rally, Atlassian Jira, and HP ALI are available.

De facto Cloud Standard

Almost every cloud-based service supports or requires Git out of the box; most don't even support SVN at all.

Reliability

Git is very reliable when it comes to managing your code. All the commands that you would use on a day-to-day basis would never leave your working copy in an inconsistent state. Even if you get stuck somewhere

SVN on the other hand has a tendency to leave your working copy in an intermediate state on failed merges, branch switching etc., making you spend hours manually cleaning out your working copy. This is one of the big reasons that SVN users rarely switch branches in the same working copy; they always use and recommend a different working copy for each branch.

Developer Productivity

Git has great branching and merging features which allow developers to perform multiple merges per day encouraging smaller units of work to be merged. This leads to a lot more manageable merging structure instead of monolithic merges.
Here is an example of merges done on the Git repository itself by one of the maintainers[1:7]:

Also, due to the fast speed and some git-specific features like stashes, it becomes super easy for a developer to switch context.

Source Code Integrity & Security

The underlying data model of a Git repository makes it tamper proof. A malicious user who has admin access to your source code repo cannot alter your repo's history without raising a red flag.[1:8]

SVN offers no such guarantees and a malicious user with admin access to the SVN repo can easily inject arbitrary code into your repositories history without detection.

References

http://www.itjobswatch.co.uk/default.aspx?page=1&sortby=0&orderby=0&q=git+svn&id=0&lid=2618


  1. http://git-scm.com/about/info-assurance ↩︎ ↩︎ ↩︎ ↩︎ ↩︎ ↩︎ ↩︎ ↩︎ ↩︎

Manuj Bhatia

Manuj Bhatia