2 Getting set to Git

2.1 Overview

Duration: 20 min

2.1.1 Questions

  • What tools do I need to partake in this workshop?
  • How can I install the tools I need for my platform?

2.1.2 Objectives

  • Get set up for learning git/GitHub and some command line.
  • Understand how to access the command line and git.

2.2 Software Setup

These setup instructions are adapted from instructions that are copyright Software Carpentry and made available for re-use by them under the CC BY 4.0 license.

The task here is to get you setup with 3 main components:

  • git - the version control software we will be studying
  • Atom - a text editor with good integration with git/GitHub
  • GitHub Account - access to the famed online git hosting service.

2.2.1 Git

2.2.1.1 Windows

Video Tutorial

The following instructions are for git for Windows 2.19.1 installer:

  1. Download the Git for Windows installer.
  2. Run the installer and follow the steps bellow:
    1. Click on “Next” to use the default install location.
    2. Click on “Next” to use the default install components.
    3. Click on “Next” to use the default Start Menu folder.
    4. Click on “Next” to use the default editor, we will change it later.
    5. Keep “Use Git from the Windows Command Prompt” selected 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.
    6. Click on “Next” to use OpenSSL library.
    7. Keep “Checkout Windows-style, commit Unix-style line endings” selected and click on “Next”.
    8. Keep “Use Windows’ default console window” selected and click on “Next”.
    9. Keep “Enable file systen caching” and “Enable Git Credential Manager” selected and click on “Next”.
    10. Do not enable experimental updates. Click on “Install”.
    11. Uncheck “View Release Notes”. 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%"
    1. Press [Enter], you should see SUCCESS: Specified value was saved.
    2. Quit command prompt by typing exit then pressing [Enter]

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

2.2.1.2 MacOS

2.2.1.2.1 Check you can access ‘Terminal’

The Terminal can be found in /Applications/Utilities or by searching spotlight for ‘Terminal’. You may want to keep Terminal in your dock for this workshop.

2.2.1.2.2 Git install option 1

Open the terminal and type:

$ git --version

If git is not installed you will get a prompt asking you if you wish to install it along with Xcode command line tools. You may be asked for your administrator password.

2.2.1.2.3 Git install option 2

Download and run the installer from: https://git-scm.com/download/mac. Hit ‘Continue’ through the prompts without modifying the installation destination or other settings. You may be asked for your administrator password.

2.2.1.3 Linux

Check you have git installed by opening your terminal and running:

$ git --version

If git is missing install is using your package manager. E.g. by running

sudo apt-get install git

In the terminal.

2.2.2 Atom text editor

2.2.2.1 Windows, MacOS, Linux

  1. Open https://atom.io/ in your browser.
  2. Click the ‘Download’ button to download the Atom installer.
  3. Once Downloaded, run the installer to install Atom.

2.2.3 GitHub

2.2.3.1 Windows, MacOS, Linux

  1. Open https://github.com in your browser
  2. Click ‘Sign up for GitHub’
  3. Enter the required personal details for step 1.
    • Note if you use a ‘.edu’ email it will be slightly easier to get unlimited private repos for free with an educational discount. Although you can change this later.
  4. In step 2 select the free plan.
  5. In step 3 you have the option to fill out a survey or immediately hit submit.
2.2.3.1.1 Optional: Register for educational discount
  1. Open https://education.github.com/ in your browser, log in to GitHub if prompted.
  2. Click ‘Join GitHub Education’
  3. Select the category that describes you, most likely the category that describes you, most likely ‘Researcher.’
  4. Fill in the rest of your details, you will need to supply an .edu email, and a brief description of your planned GitHub usage. You might say “To version and share research projects.”