Install Git For Windows

Step 1 - Install Git:

You can either Run the installer directly from your browser's File Download dialog or you can Save the file to a folder on your computer. These instructions assume you run the installer when prompted by the downloader.

If you downloaded the file to a folder on your local machine, you can also click the downloaded file's icon to run the installer. When you've successfully started the installer, you should see the Git Setup wizard screen:

The version shown on your screen may be different than the one shown here of course. That is ok as long as you are installing a Git version 1.6.6 or later.

  • Press Next to move to the next page of the wizard.
  • The setup displays the license agreement.
  • Press Next to accept the license agreement and continue.
  • For this setup, use all the default setup values recommended by installer.
  • To accept all the defaults, press Next on each page of the dialog that comes after the license agreement.
  • Press Finish on the final page of the dialog to complete the installation.

  • The system opens the release notes. You might want to skim them.
  • Close the release notes.
  • Open the Git Bash window by choosing Start > All Programs > Git > Git Bash.
    The system opens a command window:

  • Using Git Bash, you can simply enter the git command lines that appear elsewhere in the Bitbucket documentation. This documentation assumes you are familiar with a bash shell. If you want to use the Git GUI instead of Git Bash, you can, you'll need to learn that on your own though.
  • Configure your username using the following command:
    git config --global user.name "FIRST_NAME LAST_NAME"
  • Configure your email address using the following command:
    git config --global user.email "MY_NAME@example.com"

Step 2. (Optional) Install the Git credential helper on Windows 7 or 8

Bitbucket supports pushing and pulling over HTTP to your remote Git repositories on Bitbucket. Every time you interact with the remote repository, you must supply a username/password combination. Instead of supplying the combination with every HTTP call, you can store these credentials in your OSX keychain provided you have the git-credential-winstore helper added to Git.

The helper asks for your username/password on the first Git operation and then stores the credential. Future operations won't require you to supply a username/password combination. To install the helper, do the following in your Windows 7 or 8 (.NET4.0 required) environment:

  • Download the git-credential-winstore application.
  • Make a note of where you downloaded the application.
  • Start the Git Bash shell.
  • In the shell, change directory to the directory with the git-credential-winstore download.
  • Install the credential helper by entering the following at the command line.
    ./git-credential-winstore -i /bin/git
            
    

    The command updates your global Git configuration.

Step 3. Install Mercurial

TortoiseHg 2.2.1 is the Microsoft Windows version of Mercurial.

  • The version shown on your screen may be different than the one shown here of course. That is ok as long as you are installing a TortoiseHg that supports Mercurial version 1.7 or later.
  • Press Next to move to the next page of the wizard.
    The setup displays the license agreement.
  • Press Next to accept the license agreement and continue.
    For this setup, use all the default setup values recommended by installer.
  • To accept all the defaults, press Next on each page of the dialog that comes after the license agreement until the wizards prompts you to install.

  • Press Install to install the software.
  • Press Finish on the final page of the dialog to complete the installation.
    You may need to restart your system for the installation to take effect.

Do the following to configure your global default username and email:

  • Right-click in your Desktop to open the context menu.
    The system displays the right hand context menu:

  • Click the Hg Workbench item.
    The system opens the TortoiseHg Workbench application.
  • Choose File > Settings to open the TortoiseHg Settings dialog.
  • Locate the Commit section on the left hand side and click it.
  • Fill in the Username value using the following format:
    firstname lastname<email>

    When done the dialog looks similar to this:

  • Press OK to save your changes.

Step 4. Install PuTTYgen and configure PuTTY

PuTTYgen is a free RSA and DSA key generation tool. You'll learn more about RSA, DSA, and key generation later in this tutorial. If you don't have PuTTYgen installed, do the following:

  • Download the proper version for your system.
    The PuTTYgen utility is a single executable file.
  • Move the puttygen.exe executable to the C:\Program Files\TortoiseHg folder.
  • Start Putty.
    The PuTTy Configuration dialog displays. Use this dialog to configure your PuTTy sessions.
  • Under the Session node, select Default Settings and press Load.
    This allows you to edit the Default Settings session configuration.
  • Under the Connection node, click SSH.
    The Options controlling SSH connections display.
  • Check Enable compression.
    This option can improve performance of a low-band connection.
  • Click the Session node, select Default Settings and press Save.

  • Click the Close button (red x).