MSYS git

As I start my journey into learning git, I’ve had the pleasant surprise that desktop git for Windows is built on the MinGW MSYS platform. Turns out that by carefully choosing during the install you wind up with a very useful pseudo Unix environment as well as good git functionality (including the gcc compiler).

Go up to the main git site’s download page and select “Windows” to download the .exe installer.

Running the installer with a few custom options worked out for me.

1. Select Destination Location’s default, “C:Program Files(x86)Git”, is lame (only “My DocumentsGit” would be worse), I changed this to “C:Git”.

2. Select Components, change to “Simple Context Menu” — that cheetah plugin is a bit too invasive for my taste (it’s a memory resident component that can only be killed by logging out).

3. Adjusting Path Environment option 3 is really the way to go if you want to use the included MSYS tools from the Windows command line as well as in the supplied MSYS bash shell (it presents in an rxvt terminal emulator). The warning about the impact on some Windows functionality is really overstated, especially since the additions made to %PATH% are tacked on to the end of the variable data (the mappings for Windows commands come ahead of it and so will always get executed in the Windows shell rather than the MSYS versions). In fact I’ll be moving the MSYS mapping right up to the front of %PATH%, just behind those for strawberry perl (which I prefer to the older MSYS perl).

4. Configuring the line-ending conversion, I selected option 1 “Checkout Windows-style, commit Unix-style line endings” as this seemed most reasonable for working cross-platform. Could be I’ll regret this later on, but I’ll be sure to update this if that happens.

So that’s it. A stable package supporting the up-and-coming standard distributed version control system (DVCS) plus a complete set of essential Unix utilities on Windows.

Because going to a work without tar is like going to a gunfight… oh, well, you get the idea.

POSTSCRIPT: The MSYS Git installer makes certain (in my opinion, erroneous) assumptions during setup that one should be aware of.

First and foremost, it sets the global %HOME% variable to whatever was being reported as %HOME% for the installing user. On a multi-user system that’s going to cause some grief. Better to set the global %HOME% to %USERPROFILE%, which on Windows 7 will resolve to “C:UsersUSERNAME” (e.g. “C:Usersplembo”). That installing user’s home path is also set in C:Gitsetup.ini, but that doesn’t seem to affect anything so I’ve left it alone.

Secondly, if you’re on Windows 7 or Windows 8 you can (and probably should) dispense with the “C:WindowsSysWOW64cmd.exe” prefix to the Target in the Git Bash icon, and clean up the rest of the text (you can dispense with all quotes if you install to a non-long file name path like I do above).