Considering git…

Posted by – 23/04/2008

It has been some time since I’ve blogged about Subversion and how I was finding it useful. I’ve been using subversion and svk since about that time and I love it. Svk is really great and although it is more an off-line version control than a distributed one, it goes a long way for a former cvs user like myself. Lately, I’ve been considering git (isn’t everyone?).

It was not until I moved to my own hosting (thus having to maintain two subversion trees: the new one and my company’s old one) that the whole “having a central repository” started bothering me. Merging became complex, since now I have two “central” repositories, and while svk makes it a lot simpler (I just keep a mirror of the two repositories and use svk to merge between them), I began to realize that there should be a better way… I’ve watched (again) Linus’ git lecture at Google Tech Talks and decided I was going to try it.

First thing that called my attention was how easy it is to share a repository: just copy the .git directory somewhere public (an http server, for instance), and there you have it. This is much easier than configuring modules for apache, or configuring svnserve (and I’ve done that a lot in the past 3 years!).

For the subversion-only user (one that has never used svk), the carry-all-the-repository-with-you thing may sound strange, but with svk, I was used to “mirror” the repository, so that’s not an important change to me. I could not compare space utilization (and git is advertised for being more space-efficient) yet, but so far the git repositories seems to be a little smaller.

I already found it easy to branch using svk (in fact, I used to do that a lot), but git branching is really a plus! You can switch back and forth inside the same ‘working copy’ (actually I don’t think it’s correct to call that a working copy) and merging is rocket-fast! Maybe if svk could easily merge between two distinct users without requiring a subversion repository (think about the defunct svl), I would not have been trying git, but…

One thing that is really missing is the partial checkout. Actually I liked very much that svn/svk “feature”, and the clean and natural way which they treat directories and files. I understand git is designed with other priorities in mind, but, right now, that feels like missing to me. Maybe it’s just a svn/svk habit.

All in all, I found git very interesting… I am not ready to switch from svn/svk yet, but I’ll try git in small new projects and see if I can get used to it.

6 Comments on Considering git…

  1. spectra says:

    But it is as easy as copying the .git directory to any HTTP server. It will not display the files in the browser, if that’s what you want, but you can run git commands pointing to http://yourserver/the_.git_directory and it will work as a charm (read-only, obviously).

  2. spectra says:

    Hm… I have heard of mercurial but I was not aware that it could be easier on svn/svk users than git. Thanks for the tip, I’ll give it a try…

  3. erhok says:

    @Marius
    backports repo (www.backports.org) has git 1.5.4

  4. When I tried git, I was very disappointed that sharing your git repository was not just copying it into a directory served over HTTP. You also had to run some magic command to make it available, and the magic command failed when I tried it. Probably because I only had git 1.4.2 on that server—everyone says you should use at least 1.5.2. Which is not available in Debian stable, sigh.

    If you’re looking for alternatives to try, there’s also Bazaar. People say it has the best user interface (very friendly to ex-svn-users like me), but then complain about it being a bit on the slow side. To put it politely.

  5. pachi says:

    Indeed, I’d also recommend you giving a try to Mercurial. I normally use both git and Mercurial, but keep using mercurial for my own projects.
    The Mercurial book (avaliable online) is also a great resource for learning, comparable to the subversion one.

  6. cmot says:

    Hi,

    As a svn expert, you may want to try Mercurial: it is similar to git in many ways but IMHO much easier to use, especially if you come from cvs/svn.

    Haven’t used svk, so can’t compare with that.

Leave a Reply

Your email address will not be published. Required fields are marked *