Monday, March 26, 2012

git and why I sometimes feel lost

Yes, I had an affair with cvs, svn and Perforce the last couple of years! But most of the time I'm using Perforce, since this is used by my employer. Last year I started to look closer at git and mercurial. For some open source projects that I'm contributing to, I had to use git (Jenkins and homebrew) and mercurial (tamarin) to keep track of my changes. Having used Version Control Systems (VCS) for a long time, I thought that git and mercurial (hg) are just another new system that couldn't be too difficult to deal with. The start wasn't that bad: clone a repo, work locally, submitting changes locally without connection to the repository server is really a very productive feature.

How does it work if you meet somebody new and you try to build a relationship? You look for similarities and things that make it easier to find common ground. I my case I was still thinking: hey, they are all VCS's (Version Control Systems). That's true, they have a lot in common, but I also think they are more different than everybody thinks. I had to learn new concepts (which I always consider good) because of the centralized/decentralized nature of the different systems. The different terminology that all the systems use, is one of the issues that makes working not as smooth as I was used to it. Why? Every time I run into issues with branches, merges, resolving and I had to search for the "thing or situation" that described my situation best. But always in the language of the VCS that I was currently using. The longer I use the system, the better I should get to find the appropriate information quickly next time. I found numerous community driven site with tips and tricks and work flows for git and mercurial. There is the git and the mercurial handbook which will provide enough information to manage the most complex work- flows one can think of. But sometimes I'm looking for the simple tasks and how to manage them.

I'm getting better. I like git and hg. I don't love them yet, but we are working on our relationship. Even if they sometimes give me a hard time solving simple tasks, like this one: I wanted to delete a branch in one of my github repositories. As an example: in Perforce GUI tool I select the branch and delete it. Done. With git I had to do this in order to delete the branch:
git push git@github:ingorichter/homebrew.git :update-libzip
A push really deleted the branch. Perfect!? I hope I remember the command for the next time if I need to do it again.

Don't get me wrong: git and hg are very powerful, but it takes some time until your brain embraces the massive power of these VCS's. Until then, I assume that I will feel lost from time to time.

An IMHO very interesting podcast about VCS's can be found here.