Understanding Git Conceptually

Posted: April 2nd, 2009 | Author: Pierre Olivier Martel | Filed under: Git | View Comments

As developers, we take for granted the use of a VCS. I started out with CVS then Subversion and since I work with Ruby on Rails, I have been introduced to git. Working in the Rails world, you cannot avoid git (and you really shouldn’t try to!). Most plugins and gems for rails are hosted on GitHub and so basic understanding git is essential.

But only learning the basics of git is also a mistake you should avoid! When you’re learning a new language and framework, you don’t have much time (and motivation) left to learn in depth the in and outs of a new VCS. And so I have avoided really learning how git works and I only memorized the few commands I needed to commit, pull and merge.

A few weeks ago I stumbled on a great paper called understanding git conceptually. I was doubtful at first as to why I should understand the workings of git in order to better use it. I think the authors nails it right :

The conclusion I draw from this is that you can only really use Git if you understand how Git works. Merely memorizing which commands you should run at what times will work in the short run, but it’s only a matter of time before you get stuck or, worse, break something.

Reading the whole paper takes about half an hour and it helped me demistify things such as what is the difference between HEAD and head? What is a fast-forward merge? What is a commit object and how do you reference it? What is rebasing?

If you are working with git and understand don’t yet understand the concepts behind it, take half an hour to learn something useful. It will save you some precious time in the long run!