I dig git

February 13, 2009

Last Christmas I investigated some distributed revision control systems (so that I could keep on working normally despite the spotty internet connection over the holidays). Since then I’ve been using git on a daily basis for my research work and just love it. Thanks to git-svn I can still keep the original SVN backend. This has a number of advantages (sorry for reiterating a couple of points here):

  • I access my SVN repositories via HTTPS. That means they’ll work even in the most ridiculously firewalled network as long as HTTPS connections are allowed. It also means that I can browse files with just a regular web browser (and nowadays even my phone has a web browser built-in!)
  • While git’s Windows support is said to be getting better (I haven’t tried), SVN still has the best interoperability. When you’re not 100% sure what platforms have to access and commit to the project, SVN still is the best common denominator.
  • Even with git you’ll sooner or later want to create a certain central repository that you or others can push to and pull from. Like with SVN, that too will require the server to have git installed, by the way. So that repo might just as well be in SVN, given the two points above.

So, I’m still using SVN for the backend and for the frontend where necessary. Otherwise I use git. I’m probably only using 10% of its features (which is fine by me), but boy I’m sold:

  • git’s really well documented, I particularly like the insightful tips from gitready.com but the man pages and the online user manual are just as good. Compared to that, the Mercurial book is close to being useless.
  • It simply makes sense. Lots of people say git is weird and compared to SVN, it sometimes really is. But the more time I spend using git, the more I feel that this is the way it should be done. Mercurial is conceptually very similar to git and both are increasingly popular which to me seems to indicate that both must be doing something right.

One thing that falls under the “the way it should be done” category is that you can just walk up to a directory and decide you want this stuff to be version controlled. The other day I realized I wanted to extend a piece of software. I couldn’t find out whether it was still maintained and where, so I just turned the directory into a git repository and started hacking away. Maybe it is still maintained, in which case I can always ask git to spit out my modifications as patches. Or the original author could pull my changes from the public repository I’ve set up. Come to think of it, I should probably tell the original author that 🙂

You may have noticed there, I’ve simply placed a bare git repository on a web server. I love how easy and low-tech this felt: just scp’ed it over. Just to make it a bit user friendly, I added an index.html explaining what it is. I wonder how other people deal with this. I suppose folks without SSH access to webspace prefer sites like github.com and bitbucket.org? What do you do?

6 Responses to “I dig git”

  1. garbas Says:

    nice to have another gitter among ploners 🙂

    i use gitosis to manage access to repos.

  2. Martijn Faassen Says:

    I don’t know anything about git, but I tried to follow your checkout instruction here:


    and git told me:

    warning: remote HEAD refers to nonexistent ref, unable to checkout.

    and then I had a beautiful empty directory feynmf

    was that supposed to happen?

  3. garbas Says:

    i think philikon need to do: git update-server-info
    if i’m not mistaken …

    i perfer github service for public stuff, since they provide nice documentation/help for git newbies.

    • philikon Says:

      I have invoked git update-server-info prior to publishing the repo. I just tried cloning it again and it worked for me. Sorry I have no idea what’s wrong for you, Martijn.

  4. Roman Says:

    I’m currently using bzr and am quite happy with it. Used also git for a while and was quite happy with it. That’s where open source gets complicated because you have to choose one 😉

  5. philikon Says:

    Never mind, I just realized the instructions are wrong. The “public” part on the URL is wrong, you need to leave it out. I’ll update the instructions.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: