Updating Git to the Google Groups Git-OSX-Installer

gitLogo_vert.gif

As I was reading my Git Book this morning I noted that I was on v1.5.4.3 on my laptop, and it just occurred to me to check what the latest version of Git really is. I liked that this guy made an installer package that worked great as a Universal app on 10.5 (Leopard), but how far behind was he?

Turns out, a little bit.

I found that he had released a v1.5.5.0 Universal for Leopard that fixed the syncing over http, I think, but then I went to the source, and Git is really on 1.6.0.2 (stable), and that's a more significant version jump. Also, I saw that the Google Groups Git-OSX-Installer was on 1.6.0.1, and while it was Intel-only, that's all I've got for Leopard. So that seemed like a good move to make.

The first package deposited a lot of things in /usr/local/bin and such, whereas the Google Groups package is in /usr/local/git and everything is hanging off there (for the most part, we'll get to the exceptions in a minute). This looked like a cleaner uninstall as well, should Apple decide in Snow Leopard (10.6) to add in Git like they did Subversion for 10.5.

So I figured out how to get rid of the old package. Go into it's Contents directory and there should be a file called Archive.pax.gz where all the files are packed together. We can get a look at them with:

  gzip -d < Contents/Archive.pax.gz | pax -v | awk '{ print $9 }'

and all the files will be listed. Nice. I made a script to clear it all out and ran it. I then installed the new Git 1.6.0.1 package and it went in well, but the git commands like git-svn weren't in the /usr/local/git/bin directory, so they weren't going to be seen by the command line. I suppose that's not what this guy's doing, and that makes me a little nervous, but I'll go with it for now.

In order to get the paths right, I had to modify the installed file /etc/paths.d/git to look like:

  /usr/local/git/bin
  /usr/local/git/libexec/git-core

and then make use of the fact that in OS X 10.5, Leopard, the directories /etc/paths.d and /etc/manpaths.d are set up to take files listing directories to add to their respective paths if you know how to use it. So I added to my !/.tcshrc the lines:

  #
  # First, let's pick up all the paths from the system
  #
  if (-x /usr/libexec/path_helper) then
    eval `/usr/libexec/path_helper`
  endif

and we'll get the directories added to the path.

I then set up my Git global environment so that I should be ready to start working with it. I added my name and email... set up to use the colors on the commands... set up the ignore file... that kind of stuff. Nothing necessary, but all nice things to do before starting to use the tool. I think I'm ready.

Note: I like this logo for Git more as it seems to say to me the adding and deleting as well as the cycling nature of source control. And at the same time, like an emoticon, turn your head sideways and it's "Git". Sweet. Clever cats, these guys.

UPDATE: Interesting... it seems that as I read more, the commands like git-svn are really simply alternative ways of calling git commands directly. For example, git-svn is a direct command for git svn (no hyphen). This means that the Google Groups installer was right and I didn't need to add the /usr/local/git/libexec/git-core/ directory to my path! Very interesting. However, as you can imagine, if you want to call git-svn directly, then you need this directory in your path.

I've decided that the book I'm reading does not use the hyphenated commands, so I'm going to leave the install as-is and that's a big load off. It means that the guys building it are thinking the same as the author, and that's the kind of consistency I need in learning a tool like this.