The real reason Git rocks

I have learned Git. I forget about all my childhood for making space about all the magic, but I got it.

And I know because git rocks. The real reason Git rocks. And I will reveal you.

Git is a distributed Version Control System (VCS).  I love learning new VCS. I started my professional job working with ClearCase, then I used for years CVS. I took a look to Subversion, Bazaar, Darcs. Then I fall in love with Mercurial.  I stuble on git because of my personal projects like Code Zauker and Org-Mode Parser forNodeJS.

The Challenge

On these days my big Company asked me to set up an internal VCS for our enterprise needs. We are a consulting firm, and I work for international banks like UniCredit Group, Deutschebank and Intesa San Paolo. I need to provide answer to a complex challenge.

We need an architecture able to cope and sync with external VCS (tipically hosted by our customer, Banks and Financial Institution). Some customer has ClearCase, some other Subversion. The tiny banks has SourceSafe or CVS.

We need to be able to collaborate with off-shore workmate on other Countries (Japan, India, and so on…).

Security is also a concern, because banks need a high level of privacy on their core projects, as you can imagine.As side effect, sometimes our coworker needs to work behind firewalls, with only a proxed web access.

I love mercurial, so I started thinking about a distributed VCS.

Why Distributed version control

Distributed version control is very handy in today world for a simple reason: it is flexible. Allow you to work on different project, giving a different degree of contribution on every project.  You need not to be always on line to fix a bug or to experiment a new solution.

For instance, Subversion when disconnected, is only able to do a diff with your last checkout.

ClearCase has the same degree of support. It seems not a big issue, until your coworker get stuck inside a caveau and a regression pop out in the last international withdraw code.

He needs to deliver at the end of the day. And he has no way of doing a small rollback on that code because he uses the damn centralized version control system XYZ. He has no codebase right now.

The caveau air is stale and is getting worst… a long coding night based on the human memory and desperation will be his only savage… If he only learned the damned git stuff…

And this is only the visible part of the iceberg. The funniest one, anyway.

The Real Reason Ditributed VCSs  rock

As said by Joel Spolsky

With distributed version control, the distributed part is actually not the most interesting part.

The interesting part is that these systems think in terms of changes, not in terms of versions.

In Subversion, you might think, “bring my version up to date with the main version” or “go back to the previous version.”

In Mercurial, you think, “get me Jacob’s change set” or “let’s just forget that change set.”

Even if Joel talk about Mercurial, the statement is true for every DVCS.

As you can learn, DVCS give you a higher level degree of freedom.
Git gives you also the ability to do branching easily, enabling you a smart way of isolating your ideas. After your work is well isolated, you can merge two different ideas (branch) easily.
You can share (push) only a subset of your branches, and it is pretty clean

The real Reason Git rocks

Git enable you to import

  • Subversion (can also mimic svn protocol and push changes to server)
  • CVS (also incremental cohabitation is possible). Can even emulate the cvsserver.
  • SourceSafe (only here because I am kindly with failed projects)

Git can work well also with ClearCase. So git is like a magical glue: is a lot more flexible then  Subversion, and can also easy outperform ClearCase (and I am a ClearCase evangelist, guys…).

And do you ask me, how it is possible? Because

Git is fundamentally a content-addressable filesystem with a VCS user interface written on top of it

(See Pro Git by Scott Chacon)

Said in different words, Git is more a toolkit for building DVCS, then a simple VCS on its own.

So git rocks for this complex reason, and not only because

  1. it is the faster DVCS on the planet
  2. it has been written by the creator of GNU/Linux
  3. it has the most obscure feature you dream about in the last five years :)

For the exact same reason, Linux is nice not because it is a powerful Unix system.
It rocks because you have the freedom to modify and you do not need to do because…it is already better then the other O.S.s out of there…