Git Installation: Windows

In this class you will need to run commands from the Bash shell. Windows does not automatically include this (instead it has the Command Prompt). To maintain as much consistency across operating systems as possible, you need to install both the shell interface and Git. To do this, follow these instructions or watch the video tutorial:

  1. Download the Git for Windows installer.
  2. Run the installer and follow the steps bellow:
    1. Click on “Next”.
    2. Click on “Next”.
    3. Click on “Next”.
    4. Click on “Next”.
    5. Click on “Next”.
    6. Select “Use Git from the Windows Command Prompt” and click on “Next”. If you forgot to do this programs that you need for the workshop will not work properly. If this happens rerun the installer and select the appropriate option.
    7. Click on “Next”. Keep “Checkout Windows-style, commit Unix-style line endings” selected.
    8. Select “Use Windows’ default console window” and click on “Next”.
    9. Click on “Next”.
    10. Click on “Finish”.
  3. If your “HOME” environment variable is not set (or you don’t know what this is):
    1. Open command prompt (Open Start Menu then type cmd and press [Enter])
    2. Type the following line into the command prompt window exactly as shown: setx HOME "%USERPROFILE%"
    3. Press [Enter], you should see SUCCESS: Specified value was saved.
    4. Quit command prompt by typing exit then pressing [Enter]

This will provide you with both Git and Bash in the Git Bash program.

If you follow these instructions and install RStudio version 1.1 or higher, you can use the shell (also called the terminal) directly from within RStudio. See this article for more information on how to use it and setup RStudio to use Git Bash, rather than the Command Prompt.

Git Installation: Mac OS X

Video tutorial

Mac OS X already includes the shell, so all you need to do is install Git. You can obtain and install it from here.

Git Installation: Linux

If Git is not already available on your machine you can try to install it via your distro’s package manager.

Debian/Ubuntu

sudo apt-get install git

Fedora/Redhat Linux

sudo yum install git

Acknowledgments

This work is licensed under the CC BY-NC 4.0 Creative Commons License.