Git is included as an available package in Cygwin; however, it is not generally the latest stable release. Using the steps outlined below, I have been able to successfully upgrade to the latest stable release of Git within my Cygwin environment.
- Download and run the Cygwin setup-x86.exe (32-bit) or setup-x86_64.exe (64-bit) program from http://cygwin.com/install.html
If you already have Cygwin installed, that should not be a problem. You can still run the setup program to install additional Cygwin packages.
- Proceed through the Cygwin setup process until you get to the "Select Packages" screen. From there, make sure the following packages are selected:
- gettext-devel (thanks to Simon Buchan and kghastie for pointing this out)
- git (needed to retrieve most current version of git)
- xmlto (may get post-install script error)
- Open a Cygwin terminal and run the following command to retrieve the current git repository:
git clone --config core.autocrlf=false https://github.com/git/git.git
This will download the git repository to a local "git" subdirectory.
Note: There seems to be a problem with verion 1.94-1 of the ca-certificates Cygwin package where the files containing the trusted certificates are empty. This causes the following error condition:
$ git clone --config core.autocrlf=false https://github.com/git/git.git
Cloning into ‘git'...
fatal: unable to access ‘https://github.com/git/git.git/': error setting certificate verify locations:
A quick, but risky work-around is to disable SSL verification. To do this without changing any default settings, use the following command instead:
git clone --config core.autocrlf=false --config http.sslverify=false https://github.com/git/git.git
An alternative solution to fix the ca-certificates package until an update is available is described in this post.
- The local git repository will contain multiple versions of git. To select a version, follow these steps:
List the available git versions, run the following commands:
Checkout the desired version by running the following command, substituting the desired version tag name:
git checkout v126.96.36.199
- List the available git versions, run the following commands:
- Make the git configuration script by running the following command:
- Run the git configuration script to set the installation location:
- Make git programs and documentation by running the following command:
make all doc
- Install git programs and documentation by running the following command:
make install install-doc install-html
- Verify the git version by running the following command: