Evaluation: Git

Last time I talked about Mercurial, and was generally disappointed with it. I also evaluated Git, another major distributed version control system (DVCS).

Short Review: Quirky, but a promising winner.

Git, like Mercurial, was spawned as a result of the Linux-BitKeeper feud. It was written initially by Linus Torvalds, apparently during quite a lull in Linux development. It is for obvious reasons a very Linux focused tool, and I’d heard that performance is poor on Windows. I was not optimistic about it being usable on Windows.

Installation actually went very smoothly. Git for Windows is basically powered by MSYS, the same Unix tools port that accompanies the Windows GCC port called MinGW. The installer is neat and sets up everything for you. It even offers a set of shell extensions that provide a graphical interface. Note that I opted not to install this interface, and I have no idea what it’s like. A friend tells me it’s awful.

Once the installer is done, git is ready to go. It’s added to PATH and you can start cloning things right off the bat. Command line usage is simple and straightforward, and there’s even a ‘config’ option that lets you set things up nicely without having to figure out what config file you want and where it lives. It’s still a bit annoying, but I like it a lot better than Mercurial. I’ve heard some people complain about git being composed of dozens of binaries, but I haven’t seen this on either my Windows or Linux boxes. I suspect this is a complaint about old versions, where each git command was its own binary (git-commit, git-clone, git-svn, etc), but that’s long since been retired. Most of the installed binaries are just the MSYS ports of core Unix programs like ls.

I was also thrilled with the git-svn integration. Unlike Mercurial, the support is built in and flat out works with no drama whatsoever. I didn’t try committing back into the Subversion repository from git, but apparently there is fabulous two way support. It was simple enough to create a git repository but it can be time consuming, since git replays every single check-in from Subversion to itself. I tested on a small repository with only about 120 revisions, which took maybe two minutes.

This is where I have to admit I have another motive for choosing Git. My favorite VCS frontend comes in a version called SmartGit. It’s a stand-alone (not shell integrated) client that is free for non commercial use and works really well. It even handled SSH beautifully, which I’m thankful about. It’s still beta technically, but I haven’t noticed any problems.

Now the rough stuff. I already mentioned that Git for Windows comes with a GUI that is apparently not good. What I discovered is that getting git to authenticate from Windows is fairly awful. In Subversion, you actually configure users and passwords explicitly in a plain-text file. Git doesn’t support anything of the sort; their ‘git-daemon’ server allows fully anonymous pulls and can be configured for anonymous-push only. Authentication is entirely dependent on the filesystem permissions and the users configured on the server (barring workarounds), which means that most of the time, authenticated Git transactions happen inside SSH sessions. If you want to do something else, it’s complicated at best. Oh, and good luck with HTTP integration if you chose a web server other than Apache. I have to imagine running a Windows based git server is difficult.

Let me tell you about SSH on Windows. It can be unpleasant. Most people use PuTTY (which is very nice), and if you use a server with public key authentication, you’ll end up using a program called Pageant that provides that service to various applications. Pageant doesn’t use OpenSSH compatible keys, so you have to convert the keys over, and watch out because the current stable version of Pageant won’t do RSA keys. Git in turn depends on a third program called Plink, which exists to help programs talk to Pageant, and it finds that program via the GIT_SSH environment variable. The long and short of it is that getting Git to log into a public key auth SSH server is quite painful. I discovered that SmartGit simply reads OpenSSH keys and connects without any complications, so I rely on it for transactions with our main server.

I am planning to transition over to git soon, because I think that the workflow of a DVCS is better overall. It’s really clear, though, that these are raw tools compared to the much more established and stable Subversion. It’s also a little more complicated to understand; whether you’re using git, Mercurial, or something else it’s valuable to read the free ebooks that explain how to work with them. There are all kinds of quirks in these tools. Git, for example, uses a ‘staging area’ that clones your files for commit, and if you’re not careful you can wind up committing older versions of your files than what’s on disk. I don’t know why — seems like the opposite extreme from Mercurial.

It’s because of these types of issues that I favor choosing the version control system with the most momentum behind it. Git and Mercurial aren’t the only two DVCS out there; Bazaar, monotone, and many more are available. But these tools already have rough (and sharp!) edges, and by sticking to the popular ones you are likely to get the most community support. Both Git and Mercurial have full blown books dedicated to them that are available electronically for free. My advice is that you read them.

9 thoughts on “Evaluation: Git

  1. Sidenote: I use Git mainly on Linux, and have had experience with msysGit / Git for Windows only for a bit of time.


    Command line usage is simple and straightforward, and there’s even a ‘git config’ command that lets you set things up nicely without having to figure out what config file you want and where it lives.

    There is also ‘–edit’ option to ‘git config’, which opens selected config file in your editor.

    Though I wonder why SmartGit doesn’t provide graphical access to the git config file(s).


    Oh, and good luck with HTTP integration if you chose a web server other than Apache. I have to imagine running a Windows based git server is difficult.

    Git offers two flavours of HTTP integration.

    First is older “dumb” commit-walker based HTTP transport, which doesn’t need git installed to serve request, but which needs for ‘git update-server-info’ to update helper files needed by this transport (most commonly by hook, see e.g. default post-update hook sample). It requires web server capable of serving static files for fetching, and WebDAV (+ configuring authenthication to web server, on web server side) for push via HTTPS.

    Newer is “smart” git based HTTP transport, which needs git to be installed on server, or to be more exact ‘git-upload-pack’ and ‘git-receive-pack’ for fetch and push, respoectively, and also CGI script or equivalent to manage requests over HTTP. Git provides ‘git http-backend’ CGI script to serve the contents of a Git repository to Git clients accessing the repository over http:// and https:// protocols (it is backwards compatibile with older clients understanding only “dumb” HTTP transfer). The example on manpage is only for Apache, but I think any web server capable of serving CGI would suffice.


    Both Git and Mercurial have full blown books dedicated to them that are available electronically for free. My advice is that you read them.

    I recommend Pro Git book by Scott Chacon.


  2. Git, for example, uses a ‘staging area’ that clones your files for commit, and if you’re not careful you can wind up committing older versions of your files than what’s on disk. I don’t know why — seems like the opposite extreme from Mercurial.

    Actually you can use ‘git commit -a‘ to commit all changes, without staging them first. The ‘-a’ is not the default because when you need to use staging area, you really need to use it 🙂

  3. Something I wonder about Git and Mercurial is how they scale to handle the huge binary assets (models, textures, etc) created when making a big game.

    Enough people have been talking about this stuff to make me want to try them for small home projects, esp as svn annoyed me quite a few times in the last few months.

    I feel like I’m totally spoiled by Perforce at work though.

    1. My understanding is not well, at least for git. It always stores the whole repository on your local machine, which in the case of large binary assets can become mind bogglingly huge. It’s not clear to me that you should use git at all if you’re using significant binary assets, but at the very least you should probably split the project into multiple repositories of interest.

      Even that’s not great. With Perforce, what do you do? You leave it all on the server, and just sync the handful of PSD or MAX files you’re actually working with. You can’t behave like that with git, because there’s no real concept of pulling pieces of the repository.

      1. Yeah I wonder if there is room for some kind of hybrid in the future, or at least an extension to Git that used some kind of CMS.

        I do really like the idea of it though.

    2. There is git-bigfiles fork of Git, which is meant to have better support for very large files (hundreds of megabytes).

      If you search git mailing list acrhives, you would find various workarounds for better support for big files.

      1. Interesting, I’ll have to take a look at it. However my general rule of thumb is that anything that only exists in mailing list archives does not exist. It’s been one very effective way for me to filter out garbage software.

  4. If you are coming from a SVN background, Bazaar is by far the most comfortable DVCS. It supports both pull/push and checkout/commit models, it has two-way SVN integration and on the whole it is much less of a PITA to setup *and* use than Git.

    I use SVN, Git and Bazaar extensively and generally find myself gravitating towards the latter more often than not. SVN is ubiquitous but dated (and its merge support still sucks). Git is powerful but it will happily allow you to shoot yourself in the foot if you are not very very careful – at least at first. Bazaar is as powerful as Git, only without the quirks – it adapts itself to your workflow instead of making you adapt to it.

    Just my 2cc.

Leave a comment