This article discusses how to install Git on Windows without requiring Cygwin. Cygwin is a set of tools that provides a GNU (Unix/Linux) tool set on windows. If you are already a Cygwin user, you probably just want to install Git within Cygwin. If you want Git to be more integrated into your Windows environment, don't know what Cygwin is, or don't want the overhead of Cygwin this tutorial is for you. The standalone Windows Git program is called msysGit. You can download msysGit from http://code.google.com/p/msysgit/downloads/list. There are several different versions available in the repository. As someone who just wants to be a git user, you want the one labeled as the "Full installer for official Git", this includes a precompiled version of Git and the other tools you will need.
Depending on your browser configuration, you will either be able to run the installer or need to save it before you can run it, either way, you want to run the installer. As you install msysGit, you will be given a number of installation options. I recommend choosing the defaults with the following exceptions. On the "Select Components" screen under "Windows Explorer Integration", choose "Context Menu Entries", "Git Bash Here" and "Git GUI Here"
When you get to the "Adjusting Your PATH Environment Screen", I suggest choosing based on your usual command line usage patterns. If you rarely use the command line, choose "Use Git Bash Only". If you are a heavy Windows command line user (or also use Cygwin), you probably want to choose "Run Git from the Windows Command Prompt". If you are also a Unix or Linux user and like that command line, you may want to pick "Run Git and included Unix tools from the Windows Command Prompt". I would recommend the second option if you are unsure about which to choose.
When it asks you to choose an SSH executable, choose "Use OpenSSH". This may be the default, the screen varies based on what other software you have installed on your computer. I'm not including a screen shot of this window for that reason.
After setup, create a directory where you are going to keep your code. The most useful advice I got when I started programming on Windows is to create a simple easy to find and type directory like c:/code to store your source code in. Don't put in any spaces or other special characters, make it as simple as possible and keep it short and sweet. So, create your c:/code directory. Click on this directory in Windows Explorer and choose "Git Bash Here". A terminal window will open ready to run Git commands on that directory. You can use the command prompt in this window to run Git commands just as you would on a Unix or Mac command line (which is what most Git tutorials assume.) You are now ready to use Git!
Click here to see what the msysGit Bash window looks like.
|Buy Ben Lynn's book Git Magic from Amazon.com or download a copy using |
|Buy Scott Chacon's book Pro Git from Amazon.com or download a copy using |