Compiling and Installing GIT on windows under cygwin

Using GIT was one of the requirements of one of the project that I am doing. Here is how I installed GIT on Windows.

So What is GIT?

The supplied documentation of GIT says that:

Git is a fast, scalable, distributed revision control system with an unusually rich command set that provides both high-level operations and full access to internals.

Here is the link for the wikipedia entry.

Where can I download GIT?

Here is the link.

Before following the given steps you will need to install cygwin on your system, and add its bin directory to the system path (so that all the cygwin commands are available from inside the command prompt).

So after installing cygwin run setup.exe inside the cygwin installation folder and make sure the following modules are installed.

  1. make
  2. gcc c anc c++ compilers
  3. openssl-devel
  4. curl-devel
  5. Any other dependencies that are missing..

image

All these packages are located inside the Devel branch of the package tree. Required dependencies will be selected automatically.

Click next to install selected packages.

Compiling GIT form source

Untar the GIT source you downloaded using the command “tar xvzf git-1.5.5.tar.gz” .

Navigate to the untarred directory using a command prompt. Now run the “make” command inside the GIT source directory.

If it runs successfully then run “make install”.

Before running the command make sure you have Perl (language) installed. You can check it by running the command:

perl -MCPAN -e 'shell'

and then running the following inside the cpan shell:

install blib

it should show no error. I am not sure if this is the best way to do this as I am not much of a Perl guy.

So as I mentioned before you need to run the following two command to make and install Perl:

   1: make
   2: make install

If these two steps complete successfully then your GIT is ready to go :). You can test this by running the “git” command. This command is located inside the “C:/cygwin/home/gaurav/bin”. You might to add this folder to the system path too.

Pre-configured version

Here is a cygwin version pre-configured to compile GIT. It is installed on my system and works fine. Cygwin 1.5.25 and GIT 1.5.5 are preinstalled in this archive. Just decompress this archive under folder “C:\cygwin” and add “C:\cygwin\bin” and “C:/cygwin/home/gaurav/bin” to your system path and GIT should work form any command window.

Friday, April 11th, 2008 FOSS, GIT, cygwin, open source, perl, vista, windows

3 Comments to Compiling and Installing GIT on windows under cygwin

  1. What about msysGit project, so called native Windows version? I have used it in the times of quite early version, and IIRC installation was quite straightforward, and only thing to remember when using it was to run provided shell [link] to use CLI.

  2. Jakub Narebski on April 12th, 2008
  3. GIT is officially supported and fully functional only under cygwin in windows. see here.

  4. techblogger on April 12th, 2008
  5. I also needed libiconv for iconv.h.

  6. Arunan Balsubramaniam on October 13th, 2008

Leave a comment