How to install Git on Windows

If you want to install Git on Windows you have two options; using msysgit or Cygwin. Using msysgit is the easiest way and probably the most popular one, but it does not allow you to use the latest version of Git as soon as it’s released. This is one of many reasons I prefer Cygwin over msysgit but it shouldn’t be any limitation if you prefer one option over the other. Since I’m a Cygwin user, it was a natural choice for me, so fell free to chose the one that suits you best.

That said, I’ll show you how to install Git v1.7.0 using Cygwin v1.7.1-1 on Windows 7.

Installing Cygwin

Download Cygwin here and run the setup. Accept the defaults (or customize it if you prefer to install in different place) until you get to the “Select Packages” step.

To select a package, change the “View” to full, type the name in the search box and press the word “Skip” once. This will select the last available version and all the required package dependencies as shown in the picture:

Select Packages

Select the following packages:

  • zlib
  • openssh
  • openssl
  • perl
  • subversion-perl (if you want to use git-svn)
  • curl
  • libcurl-devel
  • expat
  • tcltk
  • make
  • gcc
  • ncurses (if you want to use the clear command)
  • python

Click “Next” to download and install. After installation, check the option to add an icon to the Start menu.

Installing Git

Open Cygwin bash shell (Start –> All Programs -> Cygwin -> Cygwin Bash Shell) and type the following commands to download and install Git source package:

cd /usr/src
curl -O http://kernel.org/pub/software/scm/git/git-1.7.0.tar.gz
tar xzvf git-1.7.0.tar.gz
cd git-1.7.0
./configure --prefix=/usr/local
make
make install
cd ..
which git

You should see /usr/local/bin/git.

Next, download and install the Git man pages:

curl -O http://www.kernel.org/pub/software/scm/git/git-manpages-1.7.0.tar.gz
mkdir /usr/local/man
tar xvf git-manpages-1.7.0.tar.gz -C /usr/local/man

That’s all. In the next article I’ll write about how to configure Git to integrate with tools like Notepad++ and Beyond Compare.

Shout it

9 thoughts on “How to install Git on Windows

  1. Your description of msysGit is misleading. At best. Of course you can use current Git. You just have to install the msysGit netinstaller. This is described very well on the Wiki pages, and I have no idea how you could possibly have missed it.

  2. @Dscho
    Your right, don’t know how I missed that, but since I’m a Cygwin user it was a natural choice for me to use Git on Cygwin. I’ll update the article as soon as possible. Thanks.

  3. Pingback: Eduardo Laranjeira » How to configure Git on Windows

  4. Pingback: How to configure Git on Windows

  5. @Dscho
    Can you give a link where it is written that the mysysgit netinstaller enables me to download the latest release? I work on windows and do not know how to stay uptodate.

  6. hai, m getting this error while installing Cygwin
    make: Makefile:222: fork: Resource temporarily unavailable
    . Plaz give me a solution to it

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>