git 1.8 on powershell
This morning I heard about Git 1.8 being available. I headed over to http://git-scm.com/ on my MacBook Pro and clicked Download and was all set in under a minute. I came into work this morning thinking I’d have a similar experience on my Windows VM. I went to the site and saw Latest stable release 1.8.0 but when I hit Download I was greeted with this screen telling me I’m downloading a 3 month old release of Git 1.7.11.
Three months old? No, I decided to pull the source and build the latest version of Git locally. Here’s how I did it.
Install
You’ll need to download and install msysgit from https://code.google.com/p/msysgit. Be sure to install to C:\msysgit
. This will also download and compile an older version of Git.
After the install completes you’ll be sitting at a MINGW32 command prompt. Type exit
to close this window.
Setup Powershell
On your desktop (or anywhere) create a shortcut with the following target:
%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe
"C:/msysgit/bin/sh.exe" --login -i
Like this:
Double-click this shortcut and you should see a PowerShell prompt that looks something like this:
Git 1.8
Download and compile the latest version of Git.
$ cd /c/msysgit
$ rm -rf git
$ git clone git://github.com/git/git.git
$ cd git
$ make
$ make install
$ git --version
You should see the following result:
$ git --version
git version 1.8.0
Setup Aliases (Optional)
I spend all day typing and anything that can cut the amount of typing I do is a plus for me. I create an alias to call git by typing just a g. It’s a small saving but it really adds up.
notepad ~/.profile
When Notepad opens type the following alias and save and exit:
alias g=''git''
You should now have the latest version of Git running on Windows via PowerShell with a spiffy alias that allows you to access git with a single character:
$ g --version
git version 1.8.0
- development
- git
- powershell