Cloud208 Blog

Git is a Demanding Mistress

I really like version control systems, especially when they get me out of some of my careless deeds. Other that that I prefer if I can remain unaware of them, and that they do not compete with my brain cycles with other tasks.

Git is in many ways great, but unfortunately, it requires constant attention and care. You just need to have rather deep understanding of how it operates under the hood. There are some great cheat sheets - but they will get you only so far that you get yourself hooked into git. But if you rely only on them, pretty soon you will be shooting yourself in both feet while tightening the rope around your neck.

Some of the reasons while git can be demanding stem from its roots. Once upon a time Git was a VCS toolkit assembled of procedures to manipulate git database. So it was more designed to offer nice and complete API, rather than simple command line user interface. As more people with less knowledge of git started using it, git got friendlier command line, but some things remained. For instance, imagine you have been experimenting a bit changing some files in working directory, and then you decide you just want to throw all that away, and return to last commit. It is something conceptually simple, and in my work-flow occurs on regular basis. Yet to instruct the git to perform this simple operation you have to tell it:

git reset --hard HEAD

You can find this on number of cheat sheets, but I could not remember it if my life depended on it. I mean reset sounds like a serious verb (not necessary connected or limited to what I want to do), and takes one option (--hard), and one parameter (HEAD). What if I get some of that wrong, what in the git world is going to be reseted and to which effect? So I kept googling for it each time I needed to perform this operation. Until I found this great explanation of git reset command and things now finally make some sense to me.

What I wanted to say, is there is just no easy way with git. It demands its own time and understanding, sometimes even for simple operations. I definitely like git, but it surely finds its way to drain my resources.

Posted by rush at 9 November 2011, 11:30 pm with tags git link