Compiling and Installing GIT on windows under cygwin

Posted on April 11, 2008. Filed under: cygwin, FOSS, GIT, open source, perl, vista, windows |

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.

[Update:] As pointed by @Max Git is now available as a package under Cygwin which makes compilation unnecessary.

About these ads

Make a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

7 Responses to “Compiling and Installing GIT on windows under cygwin”

RSS Feed for Blogging on Technology Comments RSS Feed

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.

GIT is officially supported and fully functional only under cygwin in windows. see here.

I also needed libiconv for iconv.h.

[...] Update March/09 — I found more detailed instructions [...]

Too many dependencies not mentioned in the INSTALL file! libiconv, expat, etc. Can’t these be documented so I can get dependencies first, then compile once? Sheesh.

when say add “C:\cygwin\bin” and “C:/cygwin/home/gaurav/bin” to your system path, could you clarify what that means / how to do it. much appreciated.

Great tutorial, as a note Git is now available within Cygwin.


Where's The Comment Form?

Liked it here?
Why not try sites on the blogroll...

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: